home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1997 February / PC Shareware 1997-02.iso / programy / envlp122 / envelop.3 / Program / dbtools.eto < prev    next >
Text File  |  1996-03-15  |  129KB  |  3,861 lines

  1.  
  2. Type DatabaseConstants From Globals
  3.   Dim DBC_READ_ONLY As Integer
  4.   Dim DBC_READ_WRITE As Integer
  5.   Dim DBC_LABEL As Integer
  6.   Dim DBC_NO_CHANGE As Long
  7.   Dim DBC_ALL As Integer
  8.  
  9.   ' METHODS for object: DatabaseConstants
  10.   Function DeSpace(ByVal OldStr as String) As String
  11.     Dim i as integer
  12.     i = 0
  13.     While i <= Len(OldStr)
  14.       If Mid$(OldStr, i, 1) = " " Then 
  15.         OldStr = Left$(OldStr, i - 1) & Right$(OldStr, Len(OldStr) - i)
  16.       Else 
  17.         i = i + 1
  18.       End If
  19.     Wend
  20.     DeSpace = OldStr
  21.   
  22.   End Function
  23.  
  24. End Type
  25.  
  26. Type DataBaseFormMaker
  27.   Dim DBFMForm As Form
  28.   Dim DBFMRecordSet As RecordSet
  29.   Dim CurrentY As Long
  30.   Dim Margin As Long
  31.   Declare Function GetTabbedTextExtent Lib "User32.dll" Alias "GetTabbedTextExtentA" (ByVal hdc As Long, ByVal lpsz As String, ByVal cchString As Long, ByVal nTabPos As Long, ByVal lpnTabStopPos As Long) As Long
  32.   Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hFont As Long) As Long
  33.   Type FieldOptions
  34.     Dim CanEdit As Boolean
  35.     Dim FieldName As String
  36.     Dim MaxLength As Integer
  37.     Dim Width As Integer
  38.     Dim Caption As String
  39.  
  40.     ' METHODS for object: DataBaseFormMaker.FieldOptions
  41.     Sub Report
  42.       Debug.Print "-----------------------------------------------"
  43.       Debug.Print "CanEdit ---- " & IIf(CanEdit, "True", "False")
  44.       Debug.Print "Caption ---- " & Caption
  45.       Debug.Print "FieldName -- " & FieldName
  46.       Debug.Print "MaxLength -- " & MaxLength
  47.       Debug.Print "Width ------ " & Width
  48.       Debug.Print "-----------------------------------------------"
  49.     End Sub
  50.  
  51.   End Type
  52.   Type OptionGroup From Group
  53.  
  54.     ' METHODS for object: DataBaseFormMaker.OptionGroup
  55.     Function Report(pos as integer) As String
  56.       Dim StackString, endl as string
  57.       endl = "^J^M"
  58.       StackString = "Report for position " & pos & endl
  59.       If pos >= Count Then 
  60.         StackString = StackString & "Out of range " & endl
  61.       Else 
  62.         StackString = StackString & "CanEdit: " & IIf(ObjectAt(pos).CanEdit, "True", "False") & endl
  63.         StackString = StackString & "Include: " & IIf(ObjectAt(pos).Include, "True", "False") & endl
  64.         StackString = StackString & "FieldName: " & ObjectAt(pos).FieldName & endl
  65.       End If
  66.       Report = StackString
  67.     
  68.     End Function
  69.  
  70.     Function SpecialField(pos as integer) As Object
  71.       Dim i as integer
  72.       If Count Then 
  73.         For i = 0 To Count - 1
  74.           If ObjectAt(i).Position = pos Then 
  75.             SpecialField = ObjectAt(i)
  76.             Exit Function
  77.           End If
  78.         Next i
  79.       End If
  80.       SpecialField = Nothing
  81.     End Function
  82.  
  83.   End Type
  84.   Dim DBLblFont As Font
  85.   Dim DBRWFont As Font
  86.   Dim DBROFont As Font
  87.   Dim LblBackColor As Long
  88.   Dim LblForeColor As Long
  89.   Dim DBROForeColor As Long
  90.   Dim DBROBackColor As Long
  91.   Dim DBRWBackColor As Long
  92.   Dim DBRWForeColor As Long
  93.   Dim DefaultFont As New Font
  94.   Dim LabelWidth As Integer
  95.   Dim LabelHeight As Integer
  96.   Dim DBFieldHeight As Integer
  97.   Dim DBROMaxCharWidth As Integer
  98.   Dim DBRWMaxCharWidth As Integer
  99.   Dim HyperWidth As Long
  100.   Dim LblFldHeight As Long
  101.  
  102.   ' METHODS for object: DataBaseFormMaker
  103.   Sub GetFontDims(ByVal TForm as Form, ByVal TFont as Font, ByVal Tstr as string, wid as integer, hei as integer)
  104.     ' WARNING: This method will do the SelectObject with on the Form with the
  105.     ' font, and not restore the original font. BE WARNED
  106.  
  107.     If TForm && TForm.hDC Then
  108.       SelectObject(TForm.hDC, IIF(TFont && TFont.HFont, TFont.HFont, DefaultFont.HFont))
  109.       GetTextExtent(TForm.hDC, Tstr, wid, hei)
  110.     End If
  111.   End Sub
  112.  
  113.   Function SetReferences(o as RecordSet) As Long
  114.     Dim flag as Boolean
  115.     Dim Pointer as Object
  116.     
  117.     DBFMRecordSet = o
  118.     Pointer = o
  119.  
  120.     While Pointer && Not(TypeOf Pointer is Form)
  121.       Pointer = HostObject(Pointer)
  122.     Wend
  123.  
  124.     If Pointer then
  125.       DBFMForm = IIF(TypeOf Pointer is DataControl, HostObject(Pointer), Pointer)
  126.       SetReferences = True
  127.     Else
  128.       SetReferences = False
  129.     End If
  130.   End Function
  131.  
  132.   Sub BuildGroup
  133.     Dim i as integer
  134.     OptionGroup.Clear
  135.     If DBFMRecordSet && DBFMRecordSet.FieldCount Then 
  136.       With DBFMRecordSet
  137.         For i = 0 To .FieldCount - 1
  138.           Dim Blank as DataBaseFormMaker.FieldOptions
  139.           Blank = CopyObject(DataBaseFormMaker.FieldOptions, "")
  140.           Blank.CanEdit = True
  141.           Blank.Include = True
  142.           .FieldIndex = i
  143.           Blank.FieldName = .FieldName
  144.           Blank.MaxLength = .FieldMaxLength
  145.           Blank.Position = i
  146.           OptionGroup.Append(Blank)
  147.         Next i
  148.       End With
  149.     End If
  150.   End Sub
  151.  
  152.   Function CalculateWidth(OldObj as Control, NewObj as Control) As Long
  153.     If OldObj.MaxLength = 0 Then 
  154.       CalculateWidth = OldObj.Width
  155.     Else 
  156.       If TypeOf NewObj Is DatabaseReadOnlyField Then 
  157.         CalculateWidth = (OldObj.MaxLength + 2) * DBROMaxCharWidth
  158.       Else 
  159.         CalculateWidth = (OldObj.MaxLength + 2) * DBRWMaxCharWidth
  160.       End If
  161.     End If
  162.   End Function
  163.  
  164.   Sub ClearColors
  165.     LblBackColor = -1
  166.     LblForeColor = -1
  167.     DBROBackColor = RGB(255, 255, 255)
  168.     DBROForeColor = -1
  169.     DBRWBackColor = -1
  170.     DBRWForeColor = -1
  171.   End Sub
  172.  
  173.   Sub CreateSet(pos as integer)
  174.     Dim Opts as DataBaseFormMaker.FieldOptions
  175.     Dim Lbl, Tb as Object
  176.     Opts = OptionGroup(pos)
  177.     If Opts.CanEdit Then 
  178.       Tb = EmbedObject(DBFMForm, DatabaseReadWriteField, UniqueEmbedName(DBFMForm, "DBRW" & DeSpace(Opts.FieldName)))
  179.     Else 
  180.       Tb = EmbedObject(DBFMForm, DatabaseReadOnlyField, UniqueEmbedName(DBFMForm, "DBRO" & DeSpace(Opts.FieldName)))
  181.     End If
  182.     ' If Width is specified, use it, otherwise use old methods
  183.     If Opts.Width Then 
  184.       Tb.Move(LabelWidth + (2 * Margin), CurrentY + ((LblFldHeight - DBFieldHeight) / 2) + Margin, Opts.Width, DBFieldHeight)
  185.     Else 
  186.       If Opts.MaxLength Then 
  187.         Tb.Move(LabelWidth + (2 * Margin), CurrentY + ((LblFldHeight - DBFieldHeight) / 2) + Margin, ((Opts.MaxLength + 2) * IIf(Opts.CanEdit, DBRWMaxCharWidth, DBROMaxCharWidth)), DBFieldHeight)
  188.       Else 
  189.         Tb.Move(LabelWidth + (2 * Margin), CurrentY + ((LblFldHeight - DBFieldHeight) / 2) + Margin, HyperWidth - Margin - LabelWidth, DBFieldHeight)
  190.       End If
  191.     End If
  192.     If Opts.Caption <> "" Then 
  193.       Lbl = EmbedObject(DBFMForm, DatabaseLabel, UniqueEmbedName(DBFMForm, "DBLbl" & DeSpace(Opts.FieldName)))
  194.       Lbl.Move(Margin, CurrentY + Margin + ((LblFldHeight - LabelHeight) / 2) , LabelWidth, LabelHeight)
  195.       Lbl.Caption = Opts.Caption & ":"
  196.     End If
  197.     Tb.MaxLength = Opts.MaxLength
  198.     CurrentY = CurrentY + LblFldHeight + Margin
  199.     Tb.DataField = Opts.FieldName
  200.     Tb.IndexPosition = pos
  201.     Tb.ZOrder = 32767
  202.   End Sub
  203.  
  204.   Sub DestroyControls
  205.     Dim o as Control
  206.     If DBFMRecordSet = Nothing Then Exit Sub
  207.     For Each o In DBFMRecordSet.Controls
  208.       DestroyObject(o)
  209.     Next o
  210.   End Sub
  211.  
  212.   Sub GetTextExtent(dc As Long, s As String, width, height as Integer)
  213.     dim result as long
  214.   
  215.     result = GetTabbedTextExtent(dc, s, Len(s), 0, 0)
  216.     ' The results are stored in the upper word and lower word of return value as pixels,
  217.     ' convert these numbers to twips before returning.
  218.     width = (result And &Hffff) * Screen.TwipsPerPixelX
  219.     height = ((result And &Hffff0000) / &H10000) * Screen.TwipsPerPixelY
  220.   End Sub
  221.  
  222.   Sub Go
  223.     Dim i as integer
  224.     If Not DBFMForm Then 
  225.       InfoBox.SetIconStop
  226.       InfoBox.Message("Fatal Error", "You must have the DBFMForm reference set")
  227.       Exit Sub
  228.     End If
  229.     If Not DBFMRecordSet Then 
  230.       InfoBox.SetIconStop
  231.       InfoBox.Message("Fatal Error", "You must have the DBFMRecordSet reference set")
  232.       Exit Sub
  233.     End If
  234.     ' Whatever CurrentY is initialized to is where the layout will begin (top)
  235.     CurrentY = 0
  236.     ' HyperWidth will be the MAXIMUM TOTAL Width of the layouy from the left of the labels
  237.     ' To the right of any Fields with no MaxChar and no specified width
  238.     DBFMForm.Show
  239.     HyperWidth = DBFMForm.ScaleWidth - 2 * Margin
  240.     ' Figure out Label and Textbox Widths
  241.     SetLabelDims
  242.     SetTemplate
  243.     For i = 0 To OptionGroup.Count - 1
  244.       CreateSet(i)
  245.     Next i
  246.     ResetTemplates
  247.     RecordSet.MoveLast
  248.     RecordSet.MoveFirst
  249.   End Sub
  250.  
  251.   Function LocateObjectByField(field as string) As Object
  252.     Dim o as Control
  253.     For Each o EmbeddedIn DBFMForm
  254.       If DBFMRecordSet = o.DataSource && o.DataField = field Then 
  255.         LocateObjectByField = o
  256.         Exit Function
  257.       End If
  258.     Next o
  259.     Throw CouldNotFindField
  260.   End Function
  261.  
  262.   Sub Modify(ByVal element as integer, ByVal NewBackColor as long, ByVal NewForeColor as long, NewFont as Font)
  263.     ' This algorithm is designed so that if Nothing is passed as the
  264.     ' last parameter, the font will not be changed. Also if DBC_NO_CHANGE
  265.     ' is passed for NewBackColor or NewForeColor, those values will
  266.     ' not be changed
  267.   
  268.     ' The algorithm will only change controls embedded in the form
  269.     ' pointed to by the DBFMForm reference who's DataSource is set to
  270.     ' the DBFMRecordSet pointed at by the DBFMRecordSet reference
  271.     Select Case element
  272.       Case DBC_READ_ONLY
  273.         Dim o as DatabaseReadOnlyField
  274.         For Each o EmbeddedIn DBFMForm
  275.           UpdateElement(o, NewBackColor, NewForeColor, NewFont)
  276.         Next o
  277.       Case DBC_READ_WRITE
  278.         Dim o as DatabaseReadWriteField
  279.         For Each o EmbeddedIn DBFMForm
  280.           UpdateElement(o, NewBackColor, NewForeColor, NewFont)
  281.         Next o
  282.       Case DBC_LABEL
  283.         Dim o as DatabaseLabel
  284.         For Each o EmbeddedIn DBFMForm
  285.           UpdateElement(o, NewBackColor, NewForeColor, NewFont)
  286.         Next o
  287.       Case Else
  288.         Throw InvalidElement
  289.     End Select
  290.   End Sub
  291.  
  292.   Sub ReconstructGroup()
  293.     Dim i as integer
  294.     Dim DataField, DataLabel as object
  295.     Dim o(100) as object
  296.     If Not DBFMRecordSet Then Throw NoDBFMRecordSet
  297.     If DBFMRecordSet.Controls.Count = 0 Then Throw EmptyDBFMRecordSet
  298.     If DBFMRecordSet.FieldCount > 100 then Redim o(DBFMRecordSet.FieldCount)
  299.     OptionGroup.Clear
  300.     For i = 0 To DBFMRecordSet.Controls.Count - 1
  301.       Dim FO as DataBaseFormMaker.FieldOptions
  302.       FO = CopyObject(DataBaseFormMaker.FieldOptions, "")
  303.       ' I'm depending on FieldOptions Defaults as CanEdit = True, and MaxLength = 0 (unlimited)
  304.       DataField = DBFMRecordSet.Controls(i)
  305.       ' We're building the list based on the Field controls, not the labels (We get the label from the Fields)
  306.       If Not TypeOf DataField Is DatabaseLabel Then 
  307.         If DataField.Parent Then DataLabel = FindEmbed(DataField.Parent, "DBLbl" & Right$(DataField.Name, Len(DataField.Name) - 4))
  308.         If TypeOf DataField Is DatabaseReadOnlyField Then FO.CanEdit = False
  309.         FO.MaxLength = DataField.MaxLength
  310.         ' Need to make a "guess" at width here as follows:
  311.         If FO.MaxLength <> 0 Then 
  312.           If DataField.Width <> (IIf(FO.CanEdit, DBRWMaxCharWidth, DBROMaxCharWidth) * (FO.MaxLength + 2)) Then 
  313.             FO.Width = DataField.Width
  314.           Else 
  315.             FO.Width = 0
  316.           End If
  317.         Else 
  318.           ' MaxLength = 0,
  319.           ' This part is left out until I decide where/if I want to store HyperWidth
  320.           If DataField.Width <> HyperWidth - LabelWidth - Margin Then 
  321.             FO.Width = DataField.Width
  322.           Else 
  323.             FO.Width = 0 ' 'I think
  324.           End If
  325.         End If
  326.         FO.Caption = IIf(DataLabel <> Nothing, Left$(DataLabel.Caption, Len(DataLabel.Caption) - 1), "*~!~*")
  327.         FO.FieldName = DataField.DataField
  328.         o(DataField.IndexPosition) = FO
  329.       End If
  330.     Next i
  331.     For i = 0 to DBFMRecordSet.FieldCount
  332.       If o(i) then OptionGroup.Append(o(i))
  333.     Next i    
  334.   End Sub
  335.  
  336.   Sub Refresh(element As Integer)
  337.     Select Case element
  338.       Case DBC_READ_ONLY
  339.         Modify(element, DBROBackColor, DBROForeColor, DBROFont)
  340.       Case DBC_READ_WRITE
  341.         Modify(element, DBRWBackColor, DBRWForeColor, DBRWFont)
  342.       Case DBC_LABEL
  343.         Modify(element, LblBackColor, LblForeColor, DBLblFont)
  344.       Case DBC_ALL
  345.         Modify(DBC_READ_ONLY, DBROBackColor, DBROForeColor, DBROFont)
  346.         Modify(DBC_READ_WRITE, DBRWBackColor, DBRWForeColor, DBRWFont)
  347.         Modify(DBC_LABEL, LblBackColor, LblForeColor, DBLblFont)
  348.     End Select
  349.   End Sub
  350.  
  351.   Sub ResetTemplates
  352.     With DatabaseReadOnlyField
  353.       .BackColor = RGB(255, 255, 255)
  354.       .ForeColor = -1
  355.       .Font = Nothing
  356.       .DataSource = Nothing
  357.     End With
  358.     With DatabaseReadWriteField
  359.       .BackColor = -1
  360.       .ForeColor = -1
  361.       .Font = Nothing
  362.       .DataSource = Nothing
  363.     End With
  364.     With DatabaseLabel
  365.       .BackColor = -1
  366.       .ForeColor = -1
  367.       .Font = Nothing
  368.       .DataSource = Nothing
  369.     End With
  370.   End Sub
  371.  
  372.   Sub SetLabelDims
  373.     Dim i as integer
  374.     Dim x,y as integer
  375.     If DBLblFont Then 
  376.       SelectObject(DBFMForm.hDC, DBLblFont.HFont)
  377.     Else 
  378.       SelectObject(DBFMForm.hDC, DefaultFont.HFont)
  379.     End If
  380.     LabelWidth = 0
  381.     LabelHeight = 0
  382.     DBFieldHeight = 0
  383.     LblFldHeight = 0
  384.     With OptionGroup
  385.       For i = 0 To .Count - 1
  386.         GetTextExtent(DBFMForm.hDC, .ObjectAt(i).Caption & ":", x, y)
  387.         x = x + (Margin)
  388.         If LabelWidth < x Then LabelWidth = x
  389.       Next i
  390.       ' Set defaults for MaxCharWidth and LabelHeight
  391.       GetTextExtent(DBFMForm.hDC, "M", x, LabelHeight)
  392.       LblFldHeight = LabelHeight
  393.     End With
  394.     ' Insure that we're large enough for DataLabels
  395.     If DBROFont Then 
  396.       SelectObject(DBFMForm.hDC, DBROFont.HFont)
  397.       GetTextExtent(DBFMForm.hDC, "M", x, y)
  398.     Else 
  399.       SelectObject(DBFMForm.hDC, DefaultFont.HFont)
  400.       GetTextExtent(DBFMForm.hDC, "M", DBROMaxCharWidth, y)
  401.     End If
  402.     DBFieldHeight = IIf(DBFieldHeight < y, y, DBFieldHeight)
  403.     DBROMaxCharWidth = x
  404.     ' Insure that we're large enough for TextBoxes
  405.     If DBRWFont Then 
  406.       SelectObject(DBFMForm.hDC, DBRWFont.HFont)
  407.       GetTextExtent(DBFMForm.hDC, "M", x, y)
  408.     Else 
  409.       SelectObject(DBFMForm.hDC, DefaultFont.HFont)
  410.       GetTextExtent(DBFMForm.hDC, "M", DBRWMaxCharWidth, y)
  411.     End If
  412.     DBFieldHeight = IIf(DBFieldHeight < y, y, DBFieldHeight)
  413.     DBRWMaxCharWidth = x
  414.     ' For our fudge factor, tack on 6 extra pixels
  415.     DBFieldHeight = DBFieldHeight + 6 * Screen.TwipsPerPixelY
  416.     LblFldHeight = IIf(DBFieldHeight > LblFldHeight, DBFieldHeight, LblFldHeight)
  417.   End Sub
  418.  
  419.   Sub SetTemplate
  420.     With DatabaseReadOnlyField
  421.       .BackColor = DBROBackColor
  422.       .ForeColor = DBROForeColor
  423.       .Font = DBROFont
  424.       .DataSource = DBFMRecordSet
  425.     End With
  426.     With DatabaseReadWriteField
  427.       .BackColor = DBRWBackColor
  428.       .ForeColor = DBRWForeColor
  429.       .Font = DBRWFont
  430.       .DataSource = DBFMRecordSet
  431.     End With
  432.     With DatabaseLabel
  433.       .BackColor = LblBackColor
  434.       .ForeColor = LblForeColor
  435.       .Font = DBLblFont
  436.       .DataSource = DBFMRecordSet
  437.     End With
  438.   End Sub
  439.  
  440.   Function SwapName(OldName as string) As String
  441.     Dim StackString as string
  442.     StackString = "DBR"
  443.     StackString = StackString & IIf(Mid$(OldName, 4, 1) = "O", "W", "O")
  444.     SwapName = StackString & Right$(OldName, Len(OldName) - 4)
  445.   End Function
  446.  
  447.   Sub ToggleReadOnly(pos as integer)
  448.     Dim OldObj, NewObj as Object
  449.     Dim OldName as string
  450.     Dim OldZOrder as Integer
  451.     SetTemplate
  452.     OldObj = LocateObjectByField(OptionGroup(pos).FieldName)
  453.     OldZOrder = OldObj.ZOrder
  454.     If TypeOf OldObj Is DatabaseReadOnlyField Then 
  455.       NewObj = EmbedObject(DBFMForm, DatabaseReadWriteField, UniqueEmbedName(DBFMForm, "Temp"))
  456.     Else 
  457.       NewObj = EmbedObject(DBFMForm, DatabaseReadOnlyField, UniqueEmbedName(DBFMForm, "Temp"))
  458.     End If
  459.     NewObj.DataSource = DBFMRecordSet
  460.     NewObj.DataField = OldObj.DataField
  461.     NewObj.MaxLength = OldObj.MaxLength
  462.     NewObj.IndexPosition = OldObj.IndexPosition
  463.     NewObj.Move(OldObj.Left, OldObj.Top, OldObj.Width, OldObj.Height)
  464.     OldName = OldObj.Name
  465.     DestroyObject(OldObj)
  466.     NewObj.Name = SwapName(OldName)
  467.     NewObj.ZOrder = OldZOrder
  468.     ResetTemplates
  469.   End Sub
  470.  
  471.   Sub UpdateElement(o as Object, NewBackColor as long, NewForeColor as long, NewFont as Object)
  472.     If o.DataSource = DBFMRecordSet Then 
  473.       With o
  474.         If NewBackColor <> DBC_NO_CHANGE Then .BackColor = NewBackColor
  475.         If NewForeColor <> DBC_NO_CHANGE Then .ForeColor = NewForeColor
  476.         If NewFont Then .Font = NewFont
  477.       End With
  478.     End If
  479.   End Sub
  480.  
  481. End Type
  482.  
  483. Type QBEDataSourceName From Form
  484.   Dim DataSourceList As New ListBox
  485.   Dim CancelBttn As New Button
  486.   Dim ConnectButton As New Button
  487.   Dim TablesButton As New Button
  488.   Dim TableList As New ListBox
  489.   Dim QueryObject As Database
  490.   Dim ConnectTextBox As New TextBox
  491.   Dim ConnectLabel As New Label
  492.   Dim DataSourceLabel As New Label
  493.   Dim TableListLabel As New Label
  494.   Dim Processing As Integer
  495.   Dim Canceled As Integer
  496.  
  497.   ' METHODS for object: QBEDataSourceName
  498.   Sub CancelBttn_Click()
  499.     Canceled = 1
  500.     QueryObject.Close()
  501.     Processing = 0
  502.     Hide
  503.   End Sub
  504.  
  505.   Sub Connect(q as Database)
  506.     dim i as integer
  507.     Processing = 1
  508.     Canceled = 0
  509.     Show
  510.     DataSourceList.Clear
  511.     TableList.Clear
  512.     ConnectTextBox.Text = ""
  513.     q.UpdateDataSources()
  514.     While (i < q.DataSourceCount)
  515.       q.DataSourceIndex = i
  516.       DataSourceList.AddItem(q.DataSourceName)
  517.       i = i + 1
  518.     Wend
  519.     DataSourceList.Refresh()
  520.     QueryObject = q
  521.   End Sub
  522.  
  523.   Sub ConnectButton_Click()
  524.     QueryObject.Connect = ConnectTextBox.Text
  525.     Hide
  526.     Processing = 0
  527.   End Sub
  528.  
  529.   Sub ConnectModal(q as Database)
  530.     dim i as integer
  531.     DataSourceList.Clear
  532.     While (i < q.DataSourceCount)
  533.       DataSourceIndex = i
  534.       DataSourceList.AddItem(q.DataSourceName)
  535.       i = i + 1
  536.     Wend
  537.     QueryObject = q
  538.   End Sub
  539.  
  540.   Sub DataSourceList_Click()
  541.     dim connectString as string
  542.     connectString = "dsn=" & DataSourceList.Text
  543.     ConnectTextBox.Text = connectString
  544.   End Sub
  545.  
  546.   Sub TablesButton_Click()
  547.     dim i as integer
  548.     TableList.Clear
  549.     ' If there is a current selection, find available tables
  550.     If DataSourceList.ListIndex <> -1 Then 
  551.       QueryObject.ConnectString = ConnectTextBox.Text
  552.       While (i < QueryObject.TableCount)
  553.         QueryObject.TableIndex = i
  554.         TableList.AddItem(QueryObject.TableName)
  555.         i = i + 1
  556.       Wend
  557.     End If
  558.   End Sub
  559.  
  560. End Type
  561.  
  562. Type QBETableData From Form
  563.   Dim FieldsList As New ListBox
  564.   Dim TablesList As New ComboBox
  565.   Dim DB As ODBC
  566.  
  567.   ' METHODS for object: QBETableData
  568.   Sub GetTables()
  569.     dim i as integer
  570.     TablesList.Clear
  571.     For i = 0 To DB.TableCount - 1
  572.       DB.TableIndex = i
  573.       TablesList.InsertItem(DB.TableName, TablesList.ListCount)
  574.     Next i
  575.     TablesList.ListIndex = 0
  576.   End Sub
  577.  
  578.   Sub MoveLeft()
  579.     Left = Left - ScaleWidth
  580.   End Sub
  581.  
  582.   Sub MoveRight()
  583.     Left = Left + ScaleWidth
  584.   End Sub
  585.  
  586.   Sub Resize()
  587.     TablesList.Move(0, 0, ScaleWidth, TablesList.Height)
  588.     FieldsList.Move(0, TablesList.Height, ScaleWidth, ScaleHeight - TablesList.Height)
  589.   End Sub
  590.  
  591.   Sub ScrollPosition(amt as Integer)
  592.     Left = Left + amt
  593.   End Sub
  594.  
  595.   Sub TablesList_Click()
  596.     dim i as integer
  597.     FieldsList.Clear
  598.     DB.TableIndex = TablesList.ListIndex
  599.     FieldsList.InsertItem("*", FieldsList.ListCount)
  600.     For i = 0 To DB.FieldCount - 1
  601.       DB.FieldIndex = i
  602.       FieldsList.InsertItem(DB.FieldName, FieldsList.ListCount)
  603.     Next i
  604.     FieldsList.ListIndex = 0
  605.   End Sub
  606.  
  607. End Type
  608.  
  609. Type PickDatabaseDriver From Form
  610.   Dim btnOK As New Button
  611.   Dim btnCancel As New Button
  612.   Dim lbDrivers As New ListBox
  613.   Dim Label1 As New Label
  614.   Dim Label2 As New Label
  615.   Dim EnvelopFont As New Font
  616.  
  617.   ' METHODS for object: PickDatabaseDriver
  618.   Sub btnCancel_Click()
  619.     ModalResult(False) : Hide
  620.   End Sub
  621.  
  622.   Sub btnOK_Click()
  623.     ModalResult(True) : Hide
  624.   End Sub
  625.  
  626.   Function Execute(db as ODBC) As String
  627.     Execute = ""
  628.     If db Then 
  629.       dim i as integer
  630.       db.UpdateDrivers
  631.       ' Make sure the form is created before filling the list.
  632.       LoadForm
  633.       lbDrivers.Clear
  634.       For i = 0 To db.DriverCount - 1
  635.         db.DriverIndex = i
  636.         lbDrivers.AddItem(db.DriverName)
  637.       Next i
  638.   
  639.       If ShowModal() Then Execute = lbDrivers.Text
  640.     End If
  641.   End Function
  642.  
  643.   Sub Resize()
  644.     const margin = 120
  645.     btnOK.Left = ScaleWidth - btnOK.Width - margin
  646.     btnCancel.Left = btnOK.Left
  647.     lbDrivers.Move(lbDrivers.Left, lbDrivers.Top, btnOK.Left - margin - lbDrivers.Left, ScaleHeight - margin - lbDrivers.Top)
  648.   End Sub
  649.  
  650. End Type
  651.  
  652. Type QBEFieldData From Form
  653.   Dim Table As New Label
  654.   Dim Field As New Label
  655.   Dim SortOrder As New ComboBox
  656.   Dim CriteriaAnd As New TextBox
  657.   Dim CriteriaOr As New TextBox
  658.  
  659.   ' METHODS for object: QBEFieldData
  660.   Sub CriteriaAnd_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  661.     DragAndDrop(source, x, y, state, effect)
  662.   End Sub
  663.  
  664.   Sub CriteriaOr_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  665.     DragAndDrop(source, x, y, state, effect)
  666.   End Sub
  667.  
  668.   Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  669.     SendEvent Parent.DragAndDrop(source, x, y, state, effect)
  670.   End Sub
  671.  
  672.   Sub Field_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  673.     DragAndDrop(source, x, y, state, effect)
  674.   End Sub
  675.  
  676.   Sub Load()
  677.     SortOrder.InsertItem("None", 0)
  678.     SortOrder.InsertItem("Ascending", 1)
  679.     SortOrder.InsertItem("Descending", 2)
  680.     SortOrder.ListIndex = 0
  681.   End Sub
  682.  
  683.   Sub MoveLeft()
  684.     Left = Left - ScaleWidth
  685.   End Sub
  686.  
  687.   Sub MoveRight()
  688.     Left = Left + ScaleWidth
  689.   End Sub
  690.  
  691.   Sub Resize()
  692.     Table.Move(0, 0, ScaleWidth, Table.Height)
  693.     Field.Move(0, Table.Height, ScaleWidth, Field.Height)
  694.     SortOrder.Move(0, Field.Height + Field.Top, ScaleWidth, SortOrder.Height)
  695.     CriteriaAnd.Move(0, SortOrder.Height + SortOrder.Top, ScaleWidth, CriteriaAnd.Height)
  696.     CriteriaOr.Move(0, CriteriaAnd.Height + CriteriaAnd.Top, ScaleWidth, CriteriaOr.Height)
  697.   End Sub
  698.  
  699.   Sub ScrollPosition(amt as Integer)
  700.     Left = Left + amt
  701.   End Sub
  702.  
  703.   Sub SortOrder_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  704.     DragAndDrop(source, x, y, state, effect)
  705.   End Sub
  706.  
  707.   Sub Table_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  708.     DragAndDrop(source, x, y, state, effect)
  709.   End Sub
  710.  
  711. End Type
  712.  
  713. Type QBE From Form
  714.   Dim Spacing As Integer
  715.   Dim Execute As New Button
  716.   Dim SQLText As New TextBox
  717.   Dim Dismiss As New Button
  718.   Dim DataConnection As ODBC
  719.   Dim LabelTable As New Label
  720.   Dim LabelField As New Label
  721.   Dim LabelSort As New Label
  722.   Dim LabelAnd As New Label
  723.   Dim LabelOr As New Label
  724.   Dim BuildSql As New Button
  725.   Type DeleteTable From Image
  726.     Dim pict As New Bitmap
  727.   End Type
  728.   Type TablesScroll From ScrollBar
  729.     Dim OldValue As Long
  730.   End Type
  731.   Dim FieldsCount As Long
  732.   Dim TablesCount As Long
  733.   Dim NewTable As New Button
  734.   Dim TablesContainer As New Form
  735.   Type FieldsContainer From Form
  736.  
  737.     ' METHODS for object: QBE.FieldsContainer
  738.     Sub AppendItem(s as string, item as string)
  739.       If s = "" Then 
  740.         s = item
  741.       Else 
  742.         s = s & ", " & item
  743.       End If
  744.     End Sub
  745.  
  746.     Sub BuildCriteriaString(criteria as string, t as string, item as string, criteriaString as String)
  747.       If criteria = "" Then Exit Sub
  748.       If criteriaString <> "" Then 
  749.         criteriaString = criteriaString & t
  750.       Else 
  751.         criteriaString = "WHERE "
  752.       End If
  753.       If criteria <> "" Then criteriaString = criteriaString & " " & item & " " & criteria
  754.     End Sub
  755.  
  756.     Sub BuildSortString(sortOrder as string, item as string, sortString as String)
  757.       dim sortOrderString as String
  758.       If sortOrder = "None" Then Exit Sub
  759.       If item = "*" Then Exit Sub
  760.       If sortOrder = "Ascending" Then 
  761.         sortOrderString = "Asc"
  762.       ElseIf sortOrder = "Descending" Then 
  763.         sortOrderString = "Desc"
  764.       End If
  765.       If sortString <> "" Then 
  766.         sortString = sortString & ", "
  767.       Else 
  768.         sortString = " ORDER BY "
  769.       End If
  770.       sortString = sortString & item & " " & sortOrderString
  771.     End Sub
  772.  
  773.     Function BuildSqlString() as String
  774.       dim i as integer
  775.       dim qry as string
  776.       dim item as string
  777.       dim tableString as string
  778.       dim fieldString as string
  779.       dim sortOrder as string
  780.       dim criteria as string
  781.     
  782.       dim q as QBEFieldData
  783.       For i = 0 To Controls.Count - 1
  784.         q = Controls(i)
  785.         item = q.Table.Text
  786.         If UniqueTable(item, i) Then AppendItem(tableString, item)
  787.         item = q.Field.Text
  788.         If item = "*" Then fieldString = "*"
  789.         If fieldString <> "*" And UniqueField(item, i) Then AppendItem(fieldString, item)
  790.         BuildSortString(q.SortOrder.Text, item, sortOrder)
  791.         BuildCriteriaString(q.CriteriaAnd.Text, " AND ", item, criteria)
  792.         BuildCriteriaString(q.CriteriaOr.Text, " OR ", item, criteria)
  793.       Next i
  794.     
  795.       If fieldString = "" Then 
  796.         BuildSqlString = ""
  797.       Else 
  798.         BuildSqlString = "SELECT " & fieldString & " FROM " & tableString & " " & criteria & " " & sortOrder
  799.       End If
  800.     End Function
  801.  
  802.     Function UniqueField(fieldName as string, i as integer) as Integer
  803.       dim j as integer
  804.       UniqueField = 1
  805.       If i <> 0 Then 
  806.         For j = 0 To i - 1
  807.           If Controls(j).Field.Text = fieldName Then UniqueField = 0
  808.         Next j
  809.       End If
  810.     End Function
  811.  
  812.     Function UniqueTable(tableName as string, i as integer) as Integer
  813.       dim j as integer
  814.       UniqueTable = 1
  815.       If i <> 0 Then 
  816.         For j = 0 To i - 1
  817.           If Controls(j).Table.Text = tableName Then UniqueTable = 0
  818.         Next j
  819.       End If
  820.     End Function
  821.  
  822.   End Type
  823.   Dim FieldsScroll As New QBE.TablesScroll
  824.  
  825.   ' METHODS for object: QBE
  826.   Function BuildQuery(db as Database) as String
  827.     dim i, res as integer
  828.     If db.Connected = False Then 
  829.       QBEDataSourceName.Connect(db)
  830.       While QBEDataSourceName.Processing
  831.         Application.DoEvents()
  832.       Wend
  833.       If QBEDataSourceName.Canceled Then Exit Function
  834.     End If
  835.     Initialize(db)
  836.     res = ShowModal()
  837.     If (res = True) Then 
  838.       BuildQuery = SQLText.Text
  839.     Else 
  840.       BuildQuery = ""
  841.     End If
  842.     CleanUp
  843.   End Function
  844.  
  845.   Sub BuildSql_Click()
  846.     SQLText.Text = FieldsContainer.BuildSqlString()
  847.   End Sub
  848.  
  849.   Sub CleanUp()
  850.     While TablesContainer.Controls.Count
  851.       DestroyObject(TablesContainer.Controls(0))
  852.     Wend
  853.     While FieldsContainer.Controls.Count
  854.       DestroyObject(FieldsContainer.Controls(0))
  855.     Wend
  856.   
  857.   End Sub
  858.  
  859.   Sub CreateFieldData(ByVal table as String, ByVal field as String)
  860.     dim ind as Integer
  861.     dim newObj as QBEFieldData
  862.     With FieldsContainer
  863.       ind = .Controls.Count
  864.       newObj = EmbedObject(FieldsContainer, QBEFieldData, UniqueEmbedName(FieldsContainer, QBEFieldData))
  865.       newObj.Table.Text = table
  866.       newObj.Field.Text = field
  867.       If (ind) Then 
  868.         newObj.Move(.Controls(ind - 1).Left + .Controls(ind - 1).Width, 0, newObj.ScaleWidth, newObj.ScaleHeight)
  869.       Else 
  870.         newObj.Move(0, 0, newObj.ScaleWidth, newObj.ScaleHeight)
  871.       End If
  872.     End With
  873.   End Sub
  874.  
  875.   Sub DeleteTable_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  876.     If TypeOf source.ObjectRef Is QBEFieldData Then 
  877.       effect = 1
  878.       If state = 3 Then 
  879.         RemoveColumn(source.ObjectRef)
  880.       End If
  881.     ElseIf TypeOf source.ObjectRef Is Control And TypeOf source.ObjectRef.Parent Is QBEFieldData Then 
  882.       effect = 1
  883.       If state = 3 Then 
  884.         RemoveColumn(source.ObjectRef.Parent)
  885.       End If
  886.     ElseIf TypeOf source.ObjectRef Is QBETableData Then 
  887.       effect = 1
  888.       If state = 3 Then 
  889.         RemoveTable(source.ObjectRef)
  890.       End If
  891.     ElseIf TypeOf source.ObjectRef Is Control And TypeOf source.ObjectRef.Parent Is QBETableData Then 
  892.       effect = 1
  893.       If state = 3 Then 
  894.         RemoveTable(source.ObjectRef.Parent)
  895.       End If
  896.     End If
  897.     Refresh
  898.   End Sub
  899.  
  900.   Sub Dismiss_Click()
  901.     Hide()
  902.     ModalResult(False)
  903.   End Sub
  904.  
  905.   Sub Execute_Click()
  906.     Hide()
  907.     BuildSql_Click()
  908.     ModalResult(True)
  909.   End Sub
  910.  
  911.   Sub FieldsContainer_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  912.     dim o as QBETableData
  913.     effect = 0
  914.     If TypeOf source.ObjectRef Is QBETableData Then 
  915.       effect = 1
  916.       If state = 3 Then 
  917.         o = source.ObjectRef
  918.         CreateFieldData(o.TablesList.Text, o.FieldsList.Text)
  919.       End If
  920.     ElseIf TypeOf source.ObjectRef Is Control And TypeOf source.ObjectRef.Parent Is QBETableData Then 
  921.       effect = 1
  922.       If state = 3 Then 
  923.         o = source.ObjectRef.Parent
  924.         CreateFieldData(o.TablesList.Text, o.FieldsList.Text)
  925.       End If
  926.     End If
  927.   End Sub
  928.  
  929.   Sub FieldsScroll_Change()
  930.     dim cnt as Integer
  931.     With FieldsContainer
  932.       If FieldsScroll.Value = FieldsScroll.OldValue Then Exit Sub
  933.       cnt = .Controls.Count
  934.       If cnt Then 
  935.         If FieldsScroll.OldValue > FieldsScroll.Value Then 
  936.           .Controls.ScrollPosition(FieldsScroll.OldValue - FieldsScroll.Value)
  937.         Else 
  938.           If cnt And .Controls(cnt - 1).Left + .Controls(cnt - 1).Width > .ScaleWidth Then 
  939.             .Controls.ScrollPosition(FieldsScroll.OldValue - FieldsScroll.Value)
  940.           Else 
  941.             FieldsScroll.Value = FieldsScroll.OldValue
  942.           End If
  943.         End If
  944.       Else 
  945.         FieldsScroll.Value = FieldsScroll.OldValue
  946.       End If
  947.     End With
  948.     FieldsScroll.OldValue = FieldsScroll.Value
  949.   End Sub
  950.  
  951.   Function FieldsShownCount() as Integer
  952.     FieldsShownCount = FieldsContainer.Controls.Count
  953.   End Function
  954.  
  955.   Sub Initialize(db as Database)
  956.     SQLText.Text = ""
  957.     DataConnection = db
  958.     NewTable_Click
  959.   End Sub
  960.  
  961.   Function IsFieldShown(field as Integer) as Integer
  962.     If FieldsCount = 0 Then 
  963.       IsFieldShown = False
  964.     Else 
  965.       IsFieldShown = True
  966.     End If
  967.   End Function
  968.  
  969.   Sub NewTable_Click()
  970.     dim ind as Integer
  971.     dim newObj as QBETableData
  972.     LoadForm()
  973.     With TablesContainer
  974.       ind = .Controls.Count
  975.       newObj = EmbedObject(TablesContainer, QBETableData, UniqueEmbedName(TablesContainer, QBETableData))
  976.       newObj.DB = DataConnection
  977.       newObj.GetTables()
  978.       If (ind) Then 
  979.         newObj.Move(.Controls(ind - 1).Left + .Controls(ind - 1).Width, 0, newObj.ScaleWidth, newObj.ScaleHeight)
  980.       Else 
  981.         newObj.Move(0, 0, newObj.ScaleWidth, newObj.ScaleHeight)
  982.       End If
  983.     End With
  984.   End Sub
  985.  
  986.   Sub RemoveColumn(item as QBEFieldData)
  987.     dim i, done as Integer
  988.   
  989.     While (i < FieldsContainer.Controls.Count) And Not done
  990.       If (item = FieldsContainer.Controls(i)) Then 
  991.         done = True
  992.       Else 
  993.         i = i + 1
  994.       End If
  995.     Wend
  996.     If (i < FieldsContainer.Controls.Count) Then DestroyObject(item)
  997.     While (i < FieldsContainer.Controls.Count)
  998.       FieldsContainer.Controls(i).MoveLeft()
  999.       i = i + 1
  1000.     Wend
  1001.   
  1002.   End Sub
  1003.  
  1004.   Sub RemoveTable(item as QBETableData)
  1005.     dim i, done as Integer
  1006.   
  1007.     While (i < TablesContainer.Controls.Count) And Not done
  1008.       If (item = TablesContainer.Controls(i)) Then 
  1009.         done = True
  1010.       Else 
  1011.         i = i + 1
  1012.       End If
  1013.     Wend
  1014.     If (i < TablesContainer.Controls.Count) Then DestroyObject(item)
  1015.     While (i < TablesContainer.Controls.Count)
  1016.       TablesContainer.Controls(i).MoveLeft()
  1017.       i = i + 1
  1018.     Wend
  1019.   
  1020.   End Sub
  1021.  
  1022.   Sub Resize()
  1023.   End Sub
  1024.  
  1025.   Sub Setup()
  1026.   End Sub
  1027.  
  1028.   Sub TablesScroll_Change()
  1029.     dim cnt as Integer
  1030.     With TablesContainer
  1031.       If TablesScroll.Value = TablesScroll.OldValue Then Exit Sub
  1032.       cnt = .Controls.Count
  1033.       If cnt Then 
  1034.         If TablesScroll.OldValue > TablesScroll.Value Then 
  1035.           .Controls.ScrollPosition(TablesScroll.OldValue - TablesScroll.Value)
  1036.         Else 
  1037.           If cnt And .Controls(cnt - 1).Left + .Controls(cnt - 1).Width > .ScaleWidth Then 
  1038.             .Controls.ScrollPosition(TablesScroll.OldValue - TablesScroll.Value)
  1039.           Else 
  1040.             TablesScroll.Value = TablesScroll.OldValue
  1041.           End If
  1042.         End If
  1043.       Else 
  1044.         TablesScroll.Value = TablesScroll.OldValue
  1045.       End If
  1046.     End With
  1047.     TablesScroll.OldValue = TablesScroll.Value
  1048.   
  1049.   End Sub
  1050.  
  1051. End Type
  1052.  
  1053. Type DataConConfigureWizard From WizardMaster.Wizard
  1054.   Dim DATASET As Object
  1055.   Type Branch From WizardMaster.FrmStep
  1056.     Dim OBAuto As New OptionButton
  1057.     Dim OBManual As New OptionButton
  1058.  
  1059.     ' METHODS for object: DataConConfigureWizard.Branch
  1060.     Sub ValidateDisplay(ok As Boolean)
  1061.       If Not initialized Then 
  1062.         OBAuto.Value = True
  1063.         initialized = True
  1064.       Else 
  1065.         If NextStep = wizard.ConfigCtrls Then 
  1066.           OBManual.Value = True
  1067.         Else 
  1068.           OBAuto.Value = True
  1069.         End If
  1070.       End If
  1071.     End Sub
  1072.  
  1073.     Sub ValidateNext(ok As Boolean)
  1074.       With wizard
  1075.     If OBAuto.Value then
  1076.       NextStep = .SelectFields
  1077.       .FormMaker.SetReferences(.DATASET)
  1078.     Else
  1079.       NextStep = .ConfigCtrls
  1080.     End If
  1081.     ' NextStep = IIf(OBAuto.Value, wizard.SelectFields, wizard.ConfigCtrls)
  1082.       End With
  1083.     End Sub
  1084.  
  1085.   End Type
  1086.   Type ConfigureFields From WizardMaster.FrmStep
  1087.     Dim Frame2 As New Frame
  1088.     Type LBLFieldName7 From Label
  1089.       Property NextField Get getNextField As Object
  1090.       Property Position Get getPosition As Integer
  1091.  
  1092.       ' METHODS for object: DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1093.       Function getNextField As Object
  1094.         Dim TempStr as string
  1095.         TempStr = "TBFieldLabel" & Position
  1096.         getNextField = FindEmbed(Parent, TempStr)
  1097.       End Function
  1098.  
  1099.       Function getPosition As Integer
  1100.         getPosition = Right$(Name, 1)
  1101.       End Function
  1102.  
  1103.       Sub HandOff(obj as object)
  1104.         If obj Then 
  1105.           Visible = True
  1106.           Caption = obj.FieldName
  1107.         Else 
  1108.           Visible = False
  1109.           Caption = ""
  1110.         End If
  1111.         NextField.HandOff(obj)
  1112.       End Sub
  1113.  
  1114.     End Type
  1115.     Type TBFieldLabel7 From TextBox
  1116.       Property Position Get getPosition As Integer
  1117.       Property NextField Get getNextField As Object
  1118.  
  1119.       ' METHODS for object: DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1120.       Function getNextField As Object
  1121.         Dim TempStr as string
  1122.         TempStr = "CHKField" & Position
  1123.         getNextField = FindEmbed(Parent, TempStr)
  1124.       End Function
  1125.  
  1126.       Function getPosition As Integer
  1127.         getPosition = Right$(Name, 1)
  1128.       End Function
  1129.  
  1130.       Sub HandOff(obj as object)
  1131.         If obj Then 
  1132.           Visible = True
  1133.           If Caption = "*~!~*" Then
  1134.             Caption = "NO LABEL"
  1135.             Enabled = False
  1136.           Else
  1137.             Caption = obj.Caption
  1138.             Enabled = True
  1139.           End If
  1140.         Else 
  1141.           Visible = False
  1142.           Caption = ""
  1143.         End If
  1144.         NextField.HandOff(obj)
  1145.       End Sub
  1146.  
  1147.       Sub LostFocus
  1148.         With Parent.wizard.FormMaker
  1149.           If Parent.Editing Then 
  1150.             Dim o as Object
  1151.             Dim n as Object
  1152.             o = .LocateObjectByField(Parent.GetField(Position)).Label
  1153.             If o Then 
  1154.               o.Caption = Text & ":"
  1155.             Else
  1156.               ' This object wasn't created...
  1157.               ' This algorithm is NOT complete
  1158.               Dim o as DatabaseLabel
  1159.               Dim l, t, w, h as Single
  1160.               w = 0
  1161.               For Each o EmbeddedIn .DBFMForm
  1162.                 l = o.Left
  1163.                 w = IIF(o.Width = 0, 15, o.Width)
  1164.                 h = o.Height
  1165.                 Exit For
  1166.               Next o
  1167.               if w = 0 then Throw NoLabels
  1168.               ' Need to figure out the top
  1169.               n = EmbedObject(.DBFMForm, DatabaseLabel, UniqueEmbedName("HookMeUp"))
  1170.               n.Move(l, t, w, h)
  1171.               ' n.DataControl hookup
  1172.             End If
  1173.           Else 
  1174.             .OptionGroup(Position + Parent.ScrollBar1.Value - 1).Caption = Text
  1175.           End If
  1176.         End With
  1177.       End Sub
  1178.  
  1179.     End Type
  1180.     Type CHKField7 From CheckBox
  1181.       Dim SuppressClicks As Integer
  1182.       Property Position Get getPosition As Integer
  1183.       Property NextField Get getNextField As Object
  1184.  
  1185.       ' METHODS for object: DataConConfigureWizard.ConfigureFields.CHKField7
  1186.       Sub Click
  1187.         If SuppressClicks = 0 Then 
  1188.           If Parent.wizard.Editing then
  1189.             Parent.wizard.FormMaker.ToggleReadOnly(Parent.ScrollBar1.Value + Position - 1)
  1190.           End If
  1191.  
  1192.       With Parent.wizard.FormMaker
  1193.         Try
  1194.           .OptionGroup(Position + Parent.ScrollBar1.Value - 1).CanEdit = IIf(Value = 0, False, True)
  1195.         Catch RangeError
  1196.         End Try
  1197.       End With
  1198.  
  1199.         End If
  1200.       End Sub
  1201.  
  1202.       Function getNextField As Object
  1203.         Dim TempStr as string
  1204.         TempStr = "TBMaxChar" & Position
  1205.         getNextField = FindEmbed(Parent, TempStr)
  1206.       End Function
  1207.  
  1208.       Function getPosition As Integer
  1209.         getPosition = Right$(Name, 1)
  1210.       End Function
  1211.  
  1212.       Sub HandOff(obj as object)
  1213.         ' Set flag to suppress handling click events.  Setting the Value
  1214.         ' on a checkbox will trigger a Click event.  We do not want
  1215.         ' process these events, since we're setting the Value to reflect
  1216.         ' the object's current state, not to change its state.
  1217.         SuppressClicks = 1
  1218.         If obj Then 
  1219.           Visible = True
  1220.           Value = IIf(obj.CanEdit, 1, 0)
  1221.         Else 
  1222.           Visible = False
  1223.           Value = 0
  1224.         End If
  1225.         SuppressClicks = 0
  1226.  
  1227.         NextField.HandOff(obj)
  1228.       End Sub
  1229.  
  1230.     End Type
  1231.     Type TBMaxChar7 From TextBox
  1232.       Property Position Get getPosition As Integer
  1233.       Property NextField Get getNextField As Object
  1234.  
  1235.       ' METHODS for object: DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1236.       Function getNextField As Object
  1237.         Dim TempStr as string
  1238.         TempStr = "TBWidth" & Position
  1239.         getNextField = FindEmbed(Parent, TempStr)
  1240.       End Function
  1241.  
  1242.       Function getPosition As Integer
  1243.         getPosition = Right$(Name, 1)
  1244.       End Function
  1245.  
  1246.       Sub HandOff(obj as object)
  1247.         If obj Then 
  1248.           Visible = True
  1249.           Caption = obj.MaxLength
  1250.         Else 
  1251.           Visible = False
  1252.           Caption = ""
  1253.         End If
  1254.         NextField.HandOff(obj)
  1255.       End Sub
  1256.  
  1257.       Sub LostFocus
  1258.         With Parent.wizard.FormMaker
  1259.           If Parent.Editing Then 
  1260.             .LocateObjectByField(Parent.GetField(Position)).MaxLength = Text
  1261.           Else 
  1262.             .OptionGroup(Position + Parent.ScrollBar1.Value - 1).MaxLength = Text
  1263.           End If
  1264.         End With
  1265.       End Sub
  1266.  
  1267.     End Type
  1268.     Type TBWidth7 From TextBox
  1269.       Property Position Get getPosition As Integer
  1270.  
  1271.       ' METHODS for object: DataConConfigureWizard.ConfigureFields.TBWidth7
  1272.       Function getPosition As Integer
  1273.         getPosition = Right$(Name, 1)
  1274.       End Function
  1275.  
  1276.       Sub HandOff(obj as object)
  1277.         If obj Then 
  1278.           Visible = True
  1279.           Caption = obj.Width
  1280.         Else 
  1281.           Visible = False
  1282.           Caption = ""
  1283.         End If
  1284.       End Sub
  1285.  
  1286.       Sub LostFocus
  1287.         With Parent.wizard.FormMaker
  1288.           If Parent.Editing Then 
  1289.             If Text = "0" Then 
  1290.               Dim o as Window
  1291.               o = .LocateObjectByField(Parent.GetField(Position))
  1292.               If o.MaxLength = 0 Then 
  1293.                 o.Width = .HyperWidth - .LabelWidth - .Margin
  1294.               Else 
  1295.                 o.Width = (2 + MaxLength) * (IIf(TypeOf o Is DatabaseReadOnlyField, .DBROMaxCharWidth, .DBRWMaxCharWidth))
  1296.               End If
  1297.             Else 
  1298.               .LocateObjectByField(Parent.GetField(Position)).Width = Text
  1299.             End If
  1300.           Else 
  1301.             .OptionGroup(Position + Parent.ScrollBar1.Value - 1).Width = Text
  1302.           End If
  1303.         End With
  1304.       End Sub
  1305.  
  1306.     End Type
  1307.     Dim TBWidth1 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1308.     Dim TBMaxChar1 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1309.     Dim CHKField1 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1310.     Dim TBFieldLabel1 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1311.     Dim LBLFieldName1 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1312.     Dim TBWidth2 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1313.     Dim TBMaxChar2 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1314.     Dim CHKField2 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1315.     Dim TBFieldLabel2 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1316.     Dim LBLFieldName2 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1317.     Dim TBWidth3 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1318.     Dim TBMaxChar3 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1319.     Dim CHKField3 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1320.     Dim TBFieldLabel3 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1321.     Dim LBLFieldName3 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1322.     Dim TBWidth4 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1323.     Dim TBMaxChar4 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1324.     Dim CHKField4 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1325.     Dim TBFieldLabel4 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1326.     Dim LBLFieldName4 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1327.     Dim TBWidth5 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1328.     Dim TBMaxChar5 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1329.     Dim CHKField5 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1330.     Dim TBFieldLabel5 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1331.     Dim LBLFieldName5 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1332.     Dim TBWidth6 As New DataConConfigureWizard.ConfigureFields.TBWidth7
  1333.     Dim TBMaxChar6 As New DataConConfigureWizard.ConfigureFields.TBMaxChar7
  1334.     Dim CHKField6 As New DataConConfigureWizard.ConfigureFields.CHKField7
  1335.     Dim TBFieldLabel6 As New DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  1336.     Dim LBLFieldName6 As New DataConConfigureWizard.ConfigureFields.LBLFieldName7
  1337.     Dim ScrollBar1 As New ScrollBar
  1338.     Dim LBLCanEditHeading As New Label
  1339.     Dim LBLCaptionHeading As New Label
  1340.     Dim LBLFieldHeading As New Label
  1341.     Dim LBLWidthHeading As New Label
  1342.     Dim LBLMaxCharHeading As New Label
  1343.     Dim ColumnGroup As New Group
  1344.     Property Editing Get getEditing As Boolean
  1345.  
  1346.     ' METHODS for object: DataConConfigureWizard.ConfigureFields
  1347.     Sub DisplayFields(TopRow as integer)
  1348.       Dim STT as New SuspendDebugExceptionTrapping
  1349.       Dim i as integer
  1350.       Dim o as Label
  1351.       Dim n as integer
  1352.       Dim g as Group
  1353.       g = wizard.FormMaker.OptionGroup
  1354.       n = g.Count - 1
  1355.       i = 0
  1356.       For Each o In ColumnGroup
  1357.         o.HandOff(IIf(i <= n, g(TopRow + i), Nothing))
  1358.         i = i + 1
  1359.       Next o
  1360.     End Sub
  1361.  
  1362.     Function getEditing As Boolean
  1363.       With wizard.FormMaker.DBFMRecordSet
  1364.         getEditing = .Controls && .Controls.Count
  1365.       End With
  1366.     End Function
  1367.  
  1368.     Function GetField(pos as integer) as string
  1369.       Dim o as object
  1370.       o = FindEmbed(Me, "LBLFieldName" & pos)
  1371.       GetField = o.Caption
  1372.     End Function
  1373.  
  1374.     Sub ScrollBar1_Change()
  1375.       DisplayFields(ScrollBar1.Value)
  1376.     End Sub
  1377.  
  1378.   End Type
  1379.   Type SelectFields From WizardMaster.FrmStep
  1380.     Dim LBFieldList As New ListBox
  1381.     Dim LBSelFields As New ListBox
  1382.     Dim BTNAddAll As New Button
  1383.     Dim BTNAdd As New Button
  1384.     Dim BTNRemove As New Button
  1385.     Dim BTNRemoveAll As New Button
  1386.     Dim LBLInclude As New Label
  1387.     Dim LBLAllFields As New Label
  1388.  
  1389.     ' METHODS for object: DataConConfigureWizard.SelectFields
  1390.     Sub BTNAddAll_Click()
  1391.       While LBFieldList.ListCount > 0
  1392.         LBFieldList.ListIndex = 0
  1393.         BTNAdd_Click
  1394.       Wend
  1395.     End Sub
  1396.  
  1397.     Sub BTNAdd_Click()
  1398.       If LBFieldList.ListIndex = -1 Then 
  1399.         Throw NoFieldSelected
  1400.       Else 
  1401.         Dim i as integer
  1402.         With LBSelFields
  1403.           Dim TheItem as string
  1404.           Dim Blank as Object
  1405.           TheItem = LBFieldList.Text
  1406.           If .ItemIndex(TheItem) = -1 Then .InsertItem(LBFieldList.Text, IIf(.ListIndex > -1, .ListIndex + 1, .ListCount))
  1407.           Blank = CopyObject(DataBaseFormMaker.FieldOptions, "")
  1408.           Blank.FieldName = TheItem
  1409.           Blank.Caption = Blank.FieldName
  1410.           ' Smart Compute MaxWidth part here
  1411.           If LBSelFields.ListIndex = -1 Then 
  1412.             DataBaseFormMaker.OptionGroup.Append(Blank)
  1413.             LBSelFields.ListIndex = LBSelFields.ListCount - 1
  1414.           Else 
  1415.             DataBaseFormMaker.OptionGroup.InsertAt(Blank, LBSelFields.ListIndex + 1)
  1416.             LBSelFields.ListIndex = LBSelFields.ListIndex + 1
  1417.           End If
  1418.           i = LBFieldList.ListIndex
  1419.         End With
  1420.         With LBFieldList
  1421.           .RemoveItem(.ListIndex)
  1422.           .ListIndex = IIf(i < .ListCount - 1, i, .ListCount - 1)
  1423.         End With
  1424.       End If
  1425.     End Sub
  1426.  
  1427.     Sub BTNRemoveAll_Click()
  1428.       LBSelFields.Clear
  1429.       FillFieldList
  1430.       wizard.FormMaker.OptionGroup.Clear
  1431.     End Sub
  1432.  
  1433.     Sub BTNRemove_Click()
  1434.       If LBSelFields.ListIndex = -1 Then 
  1435.         Throw NoSelField
  1436.       Else 
  1437.         With LBSelFields
  1438.           Dim i as integer
  1439.           SortedInsert(.Text)
  1440.           wizard.FormMaker.OptionGroup.RemoveAt(.ListIndex)
  1441.           i = .ListIndex
  1442.           .RemoveItem(.ListIndex)
  1443.           .ListIndex = IIf(i < .ListCount - 1, i, .ListCount - 1)
  1444.         End With
  1445.     
  1446.       End If
  1447.     End Sub
  1448.  
  1449.     Sub FillFieldList
  1450.       With wizard.FormMaker.DBFMRecordSet
  1451.         Dim i as integer
  1452.         LBFieldList.Clear
  1453.         For i = 0 To .FieldCount - 1
  1454.           .FieldIndex = i
  1455.           LBFieldList.AddItem(.FieldName)
  1456.         Next i
  1457.       End With
  1458.     End Sub
  1459.  
  1460.     Sub SortedInsert(item as string)
  1461.       With wizard.FormMaker.DBFMRecordSet
  1462.         Dim i as integer
  1463.         Dim j as integer
  1464.         Dim f as string
  1465.         j = 0
  1466.         For i = 0 To .FieldCount - 1
  1467.           ' Compare Database(i) with j
  1468.           .FieldIndex = i
  1469.           f = .FieldName
  1470.           If f = item Then 
  1471.             LBFieldList.InsertItem(item, j)
  1472.             LBFieldList.ListIndex = j
  1473.             Exit Sub
  1474.           End If
  1475.           If LBFieldList.List(j) = f Then j = j + 1
  1476.         Next i
  1477.         LBFieldList.AddItem(item)
  1478.       End With
  1479.     End Sub
  1480.  
  1481.   End Type
  1482.   Property FormMaker Get getFormMaker As Object
  1483.   Type SetColors From WizardMaster.FrmStep
  1484.     Dim FieldReadOnly As New Label
  1485.     Dim TBReadOnly As New TextBox
  1486.     Dim TBReadWrite As New TextBox
  1487.     Dim FieldReadWrite As New Label
  1488.     Dim LBLNotice As New Label
  1489.     Dim BTNSetROBack As New Button
  1490.     Dim BTNSetROFore As New Button
  1491.     Dim BTNSetROFont As New Button
  1492.     Dim BTNSetRWFont As New Button
  1493.     Dim BTNSetRWFore As New Button
  1494.     Dim BTNSetRWBack As New Button
  1495.     Dim BTNSetLBLFont As New Button
  1496.     Dim BTNSetLBLFore As New Button
  1497.     Dim BTNSetLBLBack As New Button
  1498.     Dim LBLSetRO As New Label
  1499.     Dim LBLSetRW As New Label
  1500.     Dim LBLSetLabel As New Label
  1501.     Dim ColorDlg As New ColorDialog
  1502.  
  1503.     ' METHODS for object: DataConConfigureWizard.SetColors
  1504.     Sub BTNSetLBLBack_Click()
  1505.       SetColor(wizard.FormMaker.LblBackColor)
  1506.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_LABEL)
  1507.     End Sub
  1508.  
  1509.     Sub BTNSetLBLFont_Click()
  1510.       Dim FP as New FontPicker
  1511.       If FP.Execute = IDOK Then 
  1512.         FieldReadOnly.Font = FP.FontRef
  1513.         FieldReadWrite.Font = FP.FontRef
  1514.         If wizard.Editing Then 
  1515.           wizard.FormMaker.Modify(DBC_LABEL, DBC_NO_CHANGE, DBC_NO_CHANGE, FP.FontRef)
  1516.         Else 
  1517.           wizard.FormMaker.DBLblFont = FP.FontRef
  1518.         End If
  1519.         LayDisplay
  1520.       End If
  1521.     End Sub
  1522.  
  1523.     Sub BTNSetLBLFore_Click()
  1524.       SetColor(wizard.FormMaker.LblForeColor)
  1525.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_LABEL)
  1526.     End Sub
  1527.  
  1528.     Sub BTNSetROBack_Click()
  1529.       SetColor(wizard.FormMaker.DBROBackColor)
  1530.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_READ_ONLY)
  1531.     End Sub
  1532.  
  1533.     Sub BTNSetROFont_Click()
  1534.       Dim FP as New FontPicker
  1535.       If FP.Execute = IDOK Then 
  1536.         TBReadOnly.Font = FP.FontRef
  1537.         If wizard.Editing Then 
  1538.           wizard.FormMaker.Modify(DBC_READ_ONLY, DBC_NO_CHANGE, DBC_NO_CHANGE, FP.FontRef)
  1539.         Else 
  1540.           wizard.FormMaker.DBROFont = FP.FontRef
  1541.         End If
  1542.         LayDisplay
  1543.       End If
  1544.     End Sub
  1545.  
  1546.     Sub BTNSetROFore_Click()
  1547.       SetColor(wizard.FormMaker.DBROForeColor)
  1548.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_READ_ONLY)
  1549.     End Sub
  1550.  
  1551.     Sub BTNSetRWBack_Click()
  1552.       SetColor(wizard.FormMaker.DBRWBackColor)
  1553.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_READ_WRITE)
  1554.     End Sub
  1555.  
  1556.     Sub BTNSetRWFont_Click()
  1557.       Dim FP as New FontPicker
  1558.       If FP.Execute = IDOK Then 
  1559.         TBReadWrite.Font = FP.FontRef
  1560.         If wizard.Editing Then 
  1561.           wizard.FormMaker.Modify(DBC_READ_WRITE, DBC_NO_CHANGE, DBC_NO_CHANGE, FP.FontRef)
  1562.         Else 
  1563.           wizard.FormMaker.DBRWFont = FP.FontRef
  1564.         End If
  1565.         LayDisplay
  1566.       End If
  1567.     End Sub
  1568.  
  1569.     Sub BTNSetRWFore_Click()
  1570.       SetColor(wizard.FormMaker.DBRWForeColor)
  1571.       If wizard.Editing Then wizard.FormMaker.Refresh(DBC_READ_WRITE)
  1572.     End Sub
  1573.  
  1574.     Sub ClearFonts()
  1575.       FieldReadOnly.Font = Nothing
  1576.       FieldReadWrite.Font = Nothing
  1577.       TBReadOnly.Font = Nothing
  1578.       TBReadWrite.Font = Nothing
  1579.     End Sub
  1580.  
  1581.     Sub LayDisplay()
  1582.       Dim SetHt as integer
  1583.       Dim Margin as integer
  1584.       Dim LblW, LblH, RWW, RWH, ROW, ROH as integer
  1585.       Dim CurX, CurY as integer
  1586.  
  1587.       ' Ensure that the Scale of the page is 15tpp
  1588.       ScaleMode = 0
  1589.       ScaleWidth = 7140
  1590.       ScaleHeight = 4410
  1591.  
  1592.       Margin = 150
  1593.  
  1594.       ' Get the dimensions
  1595.       DataBaseFormMaker.GetFontDims(Me, FieldReadOnly.Font, "Read Only:", LblW, LblH)
  1596.       DataBaseFormMaker.GetFontDims(Me, TBReadOnly.Font, "D. Gagne", ROW, ROH)
  1597.       DataBaseFormMaker.GetFontDims(Me, TBReadWrite.Font, "Active", RWW, RWH)
  1598.  
  1599.       ' Fudge the textboxes
  1600.       ROH = ROH * 1.25
  1601.       RWH = RWH * 1.25
  1602.  
  1603.       ' Figure out which is the largest variable of the three
  1604.       SetHt = LblH
  1605.       SetHt = IIf(SetHt > ROH, SetHt, ROH)
  1606.       SetHt = IIf(SetHt > RWH, SetHt, RWH)
  1607.  
  1608.       ' Since All TextBoxes are the same height, use the larger of ROH and RWH
  1609.       ROH = IIF(ROH > RWH, ROH, RWH)
  1610.  
  1611.       ' Ensure that we don't go bounding into the buttons
  1612.       If (2 * SetHt) + Margin > 1500 Then SetHt = (1500 - Margin) / 2
  1613.  
  1614.       CurX = 2850
  1615.       CurY = 525
  1616.  
  1617.       FieldReadOnly.Move(CurX, ((SetHt - LblH) / 2) + CurY, LblW, LblH)
  1618.       CurX = CurX + LblW + Margin
  1619.       TBReadOnly.Move(CurX, ((SetHt - ROH) / 2) + CurY, 6825 - CurX, ROH)
  1620.       CurX = 2850
  1621.       CurY = CurY + SetHt + Margin
  1622.       FieldReadWrite.Move(CurX, ((SetHt - LblH) / 2) + CurY, LblW, LblH)
  1623.       CurX = CurX + LblW + Margin
  1624.       TBReadWrite.Move(CurX, ((SetHt - ROH) / 2) + CurY, 6825 - CurX, ROH)
  1625.  
  1626.     End Sub
  1627.  
  1628.     Sub SetColor(OldColor as long)
  1629.       ' OldColor is INTENTIONALLY passed ByRef
  1630.     
  1631.       ColorDlg.Color = OldColor
  1632.       If ColorDlg.Execute = IDOK Then 
  1633.         OldColor = ColorDlg.Color
  1634.         SetColors
  1635.       End If
  1636.     End Sub
  1637.  
  1638.     Sub SetColors
  1639.       With wizard.FormMaker
  1640.         FieldReadOnly.BackColor = .LblBackColor
  1641.         FieldReadOnly.ForeColor = .LblForeColor
  1642.         FieldReadWrite.BackColor = .LblBackColor
  1643.         FieldReadWrite.ForeColor = .LblForeColor
  1644.         TBReadOnly.BackColor = .DBROBackColor
  1645.         TBReadOnly.ForeColor = .DBROForeColor
  1646.         TBReadWrite.BackColor = .DBRWBackColor
  1647.         TBReadWrite.ForeColor = .DBRWForeColor
  1648.       End With
  1649.     End Sub
  1650.  
  1651.     Sub SetDefaults()
  1652.       Dim DBRW as DatabaseReadWriteField
  1653.       Dim DBRO as DatabaseReadOnlyField
  1654.       Dim DBLbl as DatabaseLabel
  1655.       For Each DBRW EmbeddedIn wizard.FormMaker.DBFMForm
  1656.     With TBReadWrite
  1657.           .BackColor = DBRW.BackColor
  1658.           .ForeColor = DBRW.ForeColor
  1659.           .Font = DBRW.Font
  1660.           Exit For
  1661.         End With
  1662.       Next DBRW
  1663.       For Each DBRO EmbeddedIn wizard.FormMaker.DBFMForm
  1664.     With TBReadOnly
  1665.           .BackColor = DBRO.BackColor
  1666.           .ForeColor = DBRO.ForeColor
  1667.           .Font = DBRO.Font
  1668.           Exit For
  1669.         End With
  1670.       Next DBRO
  1671.       For Each DBLbl EmbeddedIn wizard.FormMaker.DBFMForm
  1672.     With FieldReadOnly
  1673.           .BackColor = DBLbl.BackColor
  1674.           .ForeColor = DBLbl.ForeColor
  1675.           .Font = DBLbl.Font
  1676.         End With
  1677.     With FieldReadWrite
  1678.           .BackColor = DBLbl.BackColor
  1679.           .ForeColor = DBLbl.ForeColor
  1680.           .Font = DBLbl.Font
  1681.           Exit For
  1682.         End With
  1683.       Next DBLbl
  1684.     End Sub
  1685.  
  1686.   End Type
  1687.   Property Editing Get getEditing As Boolean
  1688.   Type SelectSource From WizardMaster.FrmStep
  1689.     Dim CBSource As New ComboBox
  1690.     Dim BTNModify As New Button
  1691.     Dim BTNNew As New Button
  1692.  
  1693.     ' METHODS for object: DataConConfigureWizard.SelectSource
  1694.     Sub BTNModify_Click()
  1695.       ODBC.ManageDataSources(hWnd)
  1696.       ' Because ManageDataSources may add/remove Data Sources, regen the listbox contents
  1697.       UpdateListBoxes()
  1698.     End Sub
  1699.  
  1700.     Sub BTNNew_Click()
  1701.       dim msgStr as String
  1702.       dim SExTrp as New SuspendDebugExceptionTrapping
  1703.       Try
  1704.         If CBSource.Text = "" Then 
  1705.           msgStr = "Please enter the name of the DataSource to create."
  1706.           InfoBox.Message("Input required", msgStr)
  1707.         ElseIf (Not CBSource.ItemIndex(CBSource.Text) = -1) Then 
  1708.           msgStr = "DataSource '" & CBSource.Text & "' already exists.  Please enter new DataSource name."
  1709.           InfoBox.Message("Name conflict", msgStr)
  1710.         Else 
  1711.           Try
  1712.             ' Get the name of the driver to use
  1713.             dim drvName As String
  1714.             drvName = PickDatabaseDriver.Execute(ODBC)
  1715.             If drvName <> "" Then 
  1716.               ODBC.CreateDataSource(hWnd, drvName, CBSource.Text)
  1717.               msgStr = CBSource.Text
  1718.               UpdateListBoxes
  1719.               CBSource.ListIndex = CBSource.ItemIndex(msgStr)
  1720.             End If
  1721.           Catch
  1722.             MessageBox.Message("Failed Create New", "Could not create new DataSource, please try again")
  1723.           End Try
  1724.         End If
  1725.       Catch
  1726.       End Try
  1727.     End Sub
  1728.  
  1729.     Function UpdateListBoxes() as Boolean
  1730.       Dim ok as Boolean
  1731.       ok = False
  1732.       If (Not TypeOf wizard.DATASET Is RecordSet) && (Not TypeOf wizard.DATASET Is Dynaset) Then 
  1733.         UpdateListBoxes = ok
  1734.         Exit Function
  1735.       End If
  1736.       If (Not TypeOf wizard.DATASET.Database Is ODBC) Then wizard.DATASET.Database = Nothing
  1737.     
  1738.       ODBC.UpdateDataSources
  1739.       CBSource.Clear
  1740.       ODBC.DataSourceIndex = 0
  1741.       While (ODBC.DataSourceIndex < ODBC.DataSourceCount - 1)
  1742.         CBSource.InsertItem(ODBC.DataSourceName, ODBC.DataSourceIndex)
  1743.         ODBC.DataSourceIndex = ODBC.DataSourceIndex + 1
  1744.       Wend
  1745.       If (ODBC.DataSourceIndex = ODBC.DataSourceCount - 1) Then 
  1746.         CBSource.InsertItem(ODBC.DataSourceName, ODBC.DataSourceIndex)
  1747.         ODBC.DataSourceIndex = ODBC.DataSourceIndex + 1
  1748.       End If
  1749.       CBSource.ListIndex = CBSource.ItemIndex(wizard.DATASET.Connect)
  1750.       If (CBSource.ListIndex = -1) Then CBSource.ListIndex = 0
  1751.     
  1752.       ok = True
  1753.       UpdateListBoxes = ok
  1754.     End Function
  1755.  
  1756.   End Type
  1757.   Type FillSource From WizardMaster.FrmStep
  1758.     Dim LBTable As New ListBox
  1759.     Dim OBTable As New OptionButton
  1760.     Dim OBSQL As New OptionButton
  1761.     Dim TBSQL As New TextBox
  1762.   End Type
  1763.   Type StartStep From WizardMaster.FrmStep
  1764.     Dim OBAscii As New OptionButton
  1765.     Dim OBODBC As New OptionButton
  1766.     Dim ObjRef As DataControl
  1767.     Dim OBJump As New OptionButton
  1768.     Dim BtnWhackLayout As New Button
  1769.  
  1770.     ' METHODS for object: DataConConfigureWizard.StartStep
  1771.     Sub BtnWhackLayout_Click()
  1772.       Dim YNBox As New YesNoBox
  1773.       If YNBox.Message("Verify Destruction", "You are sure you want to destroy the existing layout") = IDYES Then 
  1774.     wizard.FormMaker.DestroyControls
  1775.     ' Enable appropriate OptButton
  1776.     If wizard.DATASET.DatabaseType = "ODBC" Then 
  1777.       OBODBC.Value = True
  1778.     Else 
  1779.       OBAscii.Value = True
  1780.     End If
  1781.     ' Disable OBJump and Hide BtnWhack
  1782.     OBJump.Enabled = False
  1783.     BtnWhackLayout.Visible = False
  1784.       End If
  1785.     End Sub
  1786.  
  1787.   End Type
  1788.   Type ConfigText From WizardMaster.FrmStep
  1789.     Dim CHKFirstLine As New CheckBox
  1790.     Dim OBDelim As New OptionButton
  1791.     Dim OBFixed As New OptionButton
  1792.     Dim LBLFieldDelim As New Label
  1793.     Dim TBFieldDelim As New TextBox
  1794.     Dim LBLNumFields As New Label
  1795.     Dim LBLFieldWidth As New Label
  1796.     Dim TBNumFields As New TextBox
  1797.     Dim TBFieldWidth As New TextBox
  1798.     Dim TBRowDelim As New TextBox
  1799.     Dim LBLRowDelim As New Label
  1800.     Dim TBRowDelimXpr As New TextBox
  1801.     Dim LBLRowDelimXpr As New Label
  1802.     Dim TBFieldDelimXpr As New TextBox
  1803.     Dim LBLFieldDelimXpr As New Label
  1804.  
  1805.     ' METHODS for object: DataConConfigureWizard.ConfigText
  1806.     Sub CHKFirstLine_Click()
  1807.       If CHKFirstLine.Value = 0 Then 
  1808.         wizard.DATASET.Database.FirstLineAsFieldNames = True
  1809.       Else 
  1810.         wizard.DATASET.Database.FirstLineAsFieldNames = False
  1811.       End If
  1812.     End Sub
  1813.  
  1814.     Sub OBDelim_Click()
  1815.       If OBDelim.Value = True Then 
  1816.         LBLRowDelim.Visible = True
  1817.         LBLRowDelimXpr.Visible = True
  1818.         LBLFieldDelimXpr.Visible = True
  1819.         TBRowDelim.Visible = True
  1820.         TBRowDelimXpr.Visible = True
  1821.         TBFieldDelimXpr.Visible = True
  1822.         TBFieldDelim.Visible = True
  1823.         TBFieldWidth.Visible = False
  1824.         TBNumFields.Visible = False
  1825.         LBLFieldDelim.Visible = True
  1826.         LBLFieldWidth.Visible = False
  1827.         LBLNumFields.Visible = False
  1828.     
  1829.         wizard.DATASET.DatabaseType = "DelimitedAscii"
  1830.         If CHKFirstLine.Value = 1 Then 
  1831.           wizard.DATASET.Database.FirstLineAsFieldNames = True
  1832.         Else 
  1833.           wizard.DATASET.Database.FirstLineAsFieldNames = False
  1834.         End If
  1835.       End If
  1836.     End Sub
  1837.  
  1838.     Sub OBFixed_Click()
  1839.       If OBFixed.Value = True Then 
  1840.         LBLRowDelim.Visible = False
  1841.         LBLRowDelimXpr.Visible = False
  1842.         LBLFieldDelimXpr.Visible = False
  1843.         TBRowDelim.Visible = False
  1844.         TBRowDelimXpr.Visible = False
  1845.         TBFieldDelimXpr.Visible = False
  1846.         TBFieldDelim.Visible = False
  1847.         TBFieldWidth.Visible = True
  1848.         TBNumFields.Visible = True
  1849.         LBLFieldDelim.Visible = False
  1850.         LBLFieldWidth.Visible = True
  1851.         LBLNumFields.Visible = True
  1852.     
  1853.         wizard.DATASET.DatabaseType = "FixedAscii"
  1854.         If CHKFirstLine.Value = 1 Then 
  1855.           wizard.DATASET.Database.FirstLineAsFieldNames = True
  1856.         Else 
  1857.           wizard.DATASET.Database.FirstLineAsFieldNames = False
  1858.         End If
  1859.       End If
  1860.     End Sub
  1861.  
  1862.     Sub TBFieldDelim_KeyUp(keyCode As Integer, ByVal shift As Integer)
  1863.       If TBFieldDelim.Text <> "" Then 
  1864.         wizard.DATASET.Database.FieldDelimiter = TBFieldDelim.Text
  1865.       End If
  1866.     End Sub
  1867.  
  1868.     Sub TBFieldWidth_KeyUp(keyCode As Integer, ByVal shift As Integer)
  1869.       If TBFieldWidth.Text <> "" Then 
  1870.         wizard.DATASET.Database.FieldWidthList = TBFieldWidth.Text
  1871.         TBNumFields.Text = wizard.DATASET.Database.FieldCount
  1872.       End If
  1873.     End Sub
  1874.  
  1875.     Sub TBNumFields_KeyUp(keyCode As Integer, ByVal shift As Integer)
  1876.       If TBNumFields.Text <> "" Then 
  1877.         wizard.DATASET.Database.FieldCount = TBNumFields.Text
  1878.         TBFieldWidth.Text = wizard.DATASET.Database.FieldWidthList
  1879.       End If
  1880.     End Sub
  1881.  
  1882.   End Type
  1883.   Type SelectFile From WizardMaster.FrmStep
  1884.     Dim TBFileName As New TextBox
  1885.     Dim BTNBrowse As New Button
  1886.     Type TBFileView From TextBox
  1887.       Dim font As New Font
  1888.     End Type
  1889.     Dim BTNViewFile As New Button
  1890.     Dim DATABASE As Database
  1891.  
  1892.     ' METHODS for object: DataConConfigureWizard.SelectFile
  1893.     Sub BTNBrowse_Click()
  1894.       dim fileNav as new OpenDialog
  1895.       dim ok as integer
  1896.       dim OldFile as string
  1897.  
  1898.       ' Use OldFile in case the user cancels the OpenDialog
  1899.       OldFile = TBFileName.Text
  1900.  
  1901.       fileNav.Filter = "*.txt"
  1902.       fileNav.FileName = "*.txt"
  1903.       ok = fileNav.Execute
  1904.       If (ok = 1) Then 
  1905.         TBFileName.Text = fileNav.FileName
  1906.         DisplayFile
  1907.       Else 
  1908.         TBFileName.Text = OldFile
  1909.       End If
  1910.     End Sub
  1911.  
  1912.     Sub BTNViewFile_Click()
  1913.       DisplayFile
  1914.     End Sub
  1915.  
  1916.     Sub DisplayFile
  1917.       dim f as new TextFile
  1918.     
  1919.       f.FileName = TBFileName.Text
  1920.       If (f.Exists) Then 
  1921.         TBFileView.Text = f.ContentsAsString
  1922.       Else 
  1923.         TBFileView.Text = ""
  1924.       End If
  1925.     End Sub
  1926.  
  1927.   End Type
  1928.   Type ConfigCtrls From WizardMaster.FrmStep
  1929.     Dim LBControls As New ListBox
  1930.     Dim BTNClearLB As New Button
  1931.     Dim LBFields As New ListBox
  1932.     Dim BTNAdd As New Button
  1933.     Dim BTNRemove As New Button
  1934.     Dim LBLControls As New Label
  1935.     Dim LBLFields As New Label
  1936.     Dim DATABASE As Database
  1937.     Dim DragFeedback As New Label
  1938.  
  1939.     ' METHODS for object: DataConConfigureWizard.ConfigCtrls
  1940.     Sub BTNAdd_Click()
  1941.       dim c as Window
  1942.     
  1943.       If (LBControls.ListIndex = -1) Then 
  1944.         InfoBox.Message("Need selection", "You must first Select a Control.")
  1945.         Exit Sub
  1946.       End If
  1947.       If (LBFields.ListIndex = -1) Then 
  1948.         InfoBox.Message("Need selection", "You must first Select a Field.")
  1949.         Exit Sub
  1950.       End If
  1951.     
  1952.       c = FindObject(LBControls.Text)
  1953.       If (c) Then 
  1954.         c.DataSource = wizard.DATASET
  1955.         c.DataField = LBFields.Text
  1956.       Else 
  1957.         LBControls.RemoveItem(LBControls.ListIndex)
  1958.       End If
  1959.     End Sub
  1960.  
  1961.     Sub BTNClearLB_Click()
  1962.       LBControls.Clear
  1963.     End Sub
  1964.  
  1965.     Sub BTNRemove_Click()
  1966.       dim c as Window
  1967.     
  1968.       If (LBControls.ListIndex = -1) Then 
  1969.         InfoBox.Message("Need selection", "You must first Select a Control.")
  1970.         Exit Sub
  1971.       End If
  1972.     
  1973.       c = FindObject(LBControls.Text)
  1974.       LBControls.RemoveItem(LBControls.ListIndex)
  1975.       If (c) Then 
  1976.         c.DataSource = Nothing
  1977.         c.DataField = ""
  1978.       End If
  1979.     End Sub
  1980.  
  1981.     Sub LBControls_Click()
  1982.       dim c as Window
  1983.       c = FindObject(LBControls.Text)
  1984.       If c Then LBFields.ListIndex = LBFields.ItemIndex(c.DataField)
  1985.     End Sub
  1986.  
  1987.     Sub LBControls_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect)
  1988.       ' We allow 'Window' type of objects, and no others.
  1989.       If TypeOf source.ObjectRef Is Window Then effect = 1 Else effect = 0
  1990.     
  1991.       If state = 2 Then 
  1992.         ' Provide feedback for any type of object
  1993.         DragFeedback.Text = source.ObjectRef
  1994.         Exit Sub
  1995.       ElseIf state = 3 && TypeOf source.ObjectRef Is Window Then 
  1996.         LBControls.InsertItem(source.ObjectRef, LBControls.ListCount)
  1997.         LBControls.ListIndex = LBControls.ListCount - 1
  1998.       End If
  1999.       ' Clear feedback after drop, and for state=Leave
  2000.       DragFeedback.Text = ""
  2001.     End Sub
  2002.  
  2003.     Sub PopulateLB(ByVal o as Object)
  2004.       Dim i as integer
  2005.     
  2006.       LBControls.Clear
  2007.     
  2008.       While Not TypeOf o Is Form
  2009.         o = HostObject(o)
  2010.       Wend
  2011.       If TypeOf o Is DataControl Then o = o.Parent
  2012.       For i = 0 To o.Controls.Count - 1
  2013.         LBControls.AddItem(o.Controls(i))
  2014.       Next i
  2015.     End Sub
  2016.  
  2017.   End Type
  2018.   Dim ConnectString As String
  2019.  
  2020.   ' METHODS for object: DataConConfigureWizard
  2021.   Function CanModify as Boolean
  2022.     If Not DATASET || Not TypeOf DATASET Is RecordSet || Not DATASET.Controls Then 
  2023.       CanModify = False
  2024.     Else 
  2025.       Dim o as object
  2026.       Dim Flag as Boolean
  2027.       Flag = False
  2028.       For Each o In DATASET.Controls
  2029.         If TypeOf o Is DatabaseLabel || TypeOf o Is DatabaseReadOnlyField || TypeOf o Is DatabaseReadWriteField Then Flag = True
  2030.       Next o
  2031.       CanModify = Flag
  2032.     End If
  2033.   End Function
  2034.  
  2035.   Sub ConfigCtrls_ValidateDisplay(ok As Boolean)
  2036.     dim I as integer
  2037.   
  2038.     ConfigCtrls.BtnFinish.Enabled = True
  2039.     ConfigCtrls.BtnCancel.Enabled = False
  2040.   
  2041.     If Not ConfigCtrls.initialized Then 
  2042.       ConfigCtrls.PopulateLB(DATASET)
  2043.       ConfigCtrls.initialized = True
  2044.     End If
  2045.     ConfigCtrls.LBFields.Clear
  2046.     For I = 0 To DATASET.FieldCount - 1
  2047.       DATASET.FieldIndex = I
  2048.       ConfigCtrls.LBFields.AddItem(DATASET.FieldName)
  2049.     Next I
  2050.   
  2051.   End Sub
  2052.  
  2053.   Sub ConfigureFields_ValidateDisplay(ok As Boolean)
  2054.     With ConfigureFields
  2055.       If .Editing Then 
  2056.         FormMaker.ReconstructGroup
  2057.         .BtnCancel.Enabled = False
  2058.         SetColors.SetDefaults
  2059.       Else
  2060.         .BtnCancel.Enabled = True
  2061.       End If
  2062.  
  2063.       If .ScrollBar1.Value <> 0 Then 
  2064.         .ScrollBar1.Value = 0
  2065.       Else 
  2066.         .DisplayFields(0)
  2067.       End If
  2068.       .ScrollBar1.Max = IIf(FormMaker.OptionGroup.Count > 7, FormMaker.OptionGroup.Count - 7, 0)
  2069.       If .ScrollBar1.Max = 0 Then 
  2070.         .ScrollBar1.Enabled = False
  2071.       Else
  2072.         .ScrollBar1.Enabled = True
  2073.       End If
  2074.     End With
  2075.   End Sub
  2076.  
  2077.   Sub ConfigureFields_ValidateFinish(ok As Boolean)
  2078.     If Not Editing Then FormMaker.Go
  2079.   End Sub
  2080.  
  2081.   Function getEditing As Boolean
  2082.     getEditing = ConfigureFields.Editing
  2083.   End Function
  2084.  
  2085.   Function getFormMaker As Object
  2086.     ' Initially this code is hard coded for the DataBaseFormMaker
  2087.     ' but this method may be changed for other FormMaker paradigns
  2088.     If FindObject("DataBaseFormMaker") Then getFormMaker = DataBaseFormMaker Else getFormMaker = Nothing
  2089.   End Function
  2090.  
  2091.   Sub SelectFields_ValidateDisplay(ok As Boolean)
  2092.     If ConfigureFields.Editing Then 
  2093.       Dim YN as New YesNoBox
  2094.       YN.title = "Editing DATASET with Controls"
  2095.       YN.message = "WARNING: Editing the order of the fields, or adding or deleting from the SelectedFields will destroy any previous work. Are you sure you want to edit the selected fields list?"
  2096.       YN.Execute
  2097.       If YN.result = IDYES Then 
  2098.         DataBaseFormMaker.DestroyControls
  2099.       Else 
  2100.         SelectFields.BtnNext_Click
  2101.         Exit Sub
  2102.       End If
  2103.     End If
  2104.     If Not SelectFields.initialized Then 
  2105.       If FormMaker Then 
  2106.         FormMaker.OptionGroup.Clear
  2107.         With SelectFields
  2108.           .FillFieldList
  2109.           .LBSelFields.Clear
  2110.           If Not Editing Then
  2111.             FormMaker.ResetTemplates
  2112.           End If
  2113.         End With
  2114.         SelectFields.initialized = True
  2115.       End If
  2116.     End If
  2117.   End Sub
  2118.  
  2119.   Sub SelectFields_ValidateFinish(ok As Boolean)
  2120.     If Not Editing Then FormMaker.Go
  2121.   End Sub
  2122.  
  2123.   Sub SelectFields_ValidateNext(ok As Boolean)
  2124.     Dim i as integer
  2125.     If SelectFields.LBSelFields.ListCount = 0 Then 
  2126.       Dim MBX as New MessageBox
  2127.       MBX.Message("No Fields", "You must select at least one field to continue")
  2128.       ok = False
  2129.     End If
  2130.     If Not FormMaker Then Throw NoFormMaker
  2131.   End Sub
  2132.  
  2133.   Sub SetColors_ValidateDisplay(ok As Boolean)
  2134.     With SetColors
  2135.       If Not .initialized Then 
  2136.     FormMaker.ClearColors
  2137.     .SetColors
  2138.     .ClearFonts
  2139.         If Editing then 
  2140.           .SetDefaults
  2141.         End If
  2142.     .initialized = True
  2143.       End If
  2144.       If Editing then
  2145.         .BtnCancel.Enabled = False
  2146.       Else
  2147.         .BtnCancel.Enabled = True
  2148.       End If
  2149.       .LayDisplay
  2150.     End With
  2151.   End Sub
  2152.  
  2153.   Sub SetColors_ValidateFinish(ok As Boolean)
  2154.     If Not Editing Then FormMaker.Go
  2155.   End Sub
  2156.  
  2157.   Sub ConfigText_ValidateDisplay(ok As Boolean)
  2158.     ConfigText.BtnFinish.Enabled = False
  2159.     ConfigText.BtnCancel.Enabled = True
  2160.   
  2161.     ' If we're working with a Dynaset, we don't need to configure
  2162.     ' controls
  2163.     If TypeOf DATASET Is Dynaset Then 
  2164.       ConfigText.NextStep = Nothing
  2165.       ConfigText.BtnNext.Enabled = False
  2166.       ConfigText.BtnFinish.Enabled = True
  2167.     Else 
  2168.       ConfigText.NextStep = Branch
  2169.       ConfigText.BtnNext.Enabled = True
  2170.       ConfigText.BtnFinish.Enabled = False
  2171.     End If
  2172.   
  2173.     If DATASET.DatabaseType <> "None" Then 
  2174.       If DATASET.Database.FirstLineAsFieldNames = True Then 
  2175.         ConfigText.CHKFirstLine.Value = 1
  2176.       Else 
  2177.         ConfigText.CHKFirstLine.Value = 0
  2178.       End If
  2179.     End If
  2180.   
  2181.     Select Case DATASET.DatabaseType
  2182.       Case "None"
  2183.         ConfigText.OBDelim.Value = True
  2184.         DATASET.DatabaseType = "DelimitedAscii"
  2185.         ConfigText.OBFixed.Value = False
  2186.         ConfigText.TBFieldDelim.Text = ","
  2187.         DATASET.Database.FieldDelimiter = ","
  2188.         ConfigText.TBFieldDelimXpr.Text = DATASET.Database.FieldDelimiterExpr
  2189.         ConfigText.TBRowDelim.Text = "^^M^^J"
  2190.         DATASET.Database.RowDelimiter = "^M^J"
  2191.         ConfigText.TBRowDelimXpr.Text = DATASET.Database.RowDelimiterExpr
  2192.         ConfigText.TBNumFields.Text = "4"
  2193.         ConfigText.TBFieldWidth.Text = "10, 10, 10, 10"
  2194.       Case "DelimitedAscii"
  2195.         ConfigText.OBFixed.Value = False
  2196.         ConfigText.OBDelim.Value = True
  2197.         ConfigText.TBNumFields.Text = "4"
  2198.         ConfigText.TBFieldWidth.Text = "10, 10, 10, 10"
  2199.         ConfigText.TBFieldDelim.Text = DATASET.Database.FieldDelimiter
  2200.         ConfigText.TBFieldDelimXpr.Text = DATASET.Database.FieldDelimiterExpr
  2201.         If DATASET.Database.RowDelimiter = "^M^J" Then 
  2202.           ConfigText.TBRowDelim.Text = "^^M^^J"
  2203.         Else 
  2204.           ConfigText.TBRowDelim.Text = DATASET.Database.RowDelimiter
  2205.         End If
  2206.         If DATASET.Database.RowDelimiterExpr = "^M^J" Then 
  2207.           ConfigText.TBRowDelimXpr.Text = "^^M^^J"
  2208.         Else 
  2209.           ConfigText.TBRowDelimXpr.Text = DATASET.Database.RowDelimiterExpr
  2210.         End If
  2211.       Case "FixedAscii"
  2212.         ConfigText.OBFixed.Value = True
  2213.         ConfigText.OBDelim.Value = False
  2214.         ConfigText.TBFieldDelim.Text = ","
  2215.         ConfigText.TBNumFields.Text = DATASET.Database.FieldCount
  2216.         ConfigText.TBFieldWidth.Text = DATASET.Database.FieldWidthList
  2217.     End Select
  2218.   End Sub
  2219.  
  2220.   Sub ConfigText_ValidateFinish(ok as Boolean)
  2221.     If TypeOf DATASET Is Dynaset Then 
  2222.       ConfigText_ValidateNext(ok)
  2223.     Else 
  2224.       MessageBox.Message("Error", "You may not finish at this point unless the RecordSet in question is a Dynaset")
  2225.     End If
  2226.   End Sub
  2227.  
  2228.   Sub ConfigText_ValidateNext(ok As Boolean)
  2229.     ok = False
  2230.   
  2231.     If ConfigText.OBFixed.Value = True Then 
  2232.       If ConfigText.TBNumFields.Text = "" Then 
  2233.         InfoBox.Message("DataControl Configuration", "A FixedTable must have a Number of Fields.")
  2234.         ok = False
  2235.         Exit Sub
  2236.       End If
  2237.       If ConfigText.TBFieldWidth.Text = "" Then 
  2238.         InfoBox.Message("DataControl Configuration", "A FixedTable must have a Field Width.")
  2239.         ok = False
  2240.         Exit Sub
  2241.       End If
  2242.       DATASET.DatabaseType = "FixedAscii"
  2243.       DATASET.Database.FieldCount = ConfigText.TBNumFields.Text
  2244.       DATASET.Database.FieldWidthList = ConfigText.TBFieldWidth.Text
  2245.       DATASET.Connect = ConnectString
  2246.     Else 
  2247.       If ConfigText.TBFieldDelim.Text = "" Then 
  2248.         InfoBox.Message("DataControl Configuration", "A DelimitedAscii Table must have a Field Delimiter.")
  2249.         ok = False
  2250.         Exit Sub
  2251.       End If
  2252.       DATASET.DatabaseType = "DelimitedAscii"
  2253.       DATASET.Database.FieldDelimiter = ExpandCtrlCharSequences(ConfigText.TBFieldDelim.Text)
  2254.       DATASET.Database.FieldDelimiterExpr = ExpandCtrlCharSequences(ConfigText.TBFieldDelimXpr.Text)
  2255.       DATASET.Database.RowDelimiter = ExpandCtrlCharSequences(ConfigText.TBRowDelim.Text)
  2256.       DATASET.Database.RowDelimiterExpr = ExpandCtrlCharSequences(ConfigText.TBRowDelimXpr.Text)
  2257.     End If
  2258.   
  2259.     If ConfigText.CHKFirstLine.Value = 1 Then 
  2260.       DATASET.Database.FirstLineAsFieldNames = True
  2261.     Else 
  2262.       DATASET.Database.FirstLineAsFieldNames = False
  2263.     End If
  2264.   
  2265.     DATASET.Connect = ConnectString
  2266.     DATASET.Refresh
  2267.     ok = True
  2268.   End Sub
  2269.  
  2270.   Sub Edit(o as Object)
  2271.     If (o && (TypeOf o Is Dynaset || TypeOf o Is RecordSet)) Then 
  2272.       DATASET = o
  2273.       Show
  2274.     ElseIf (o && TypeOf o Is DataControl) Then 
  2275.       DATASET = o.RecordSet
  2276.       Show
  2277.     Else 
  2278.       Error
  2279.     End If
  2280.   End Sub
  2281.  
  2282.   Sub FillSource_ValidateDisplay(ok As Boolean)
  2283.     dim d as Database
  2284.     dim i as Integer
  2285.     FillSource.BtnFinish.Enabled = False
  2286.     FillSource.BtnCancel.Enabled = True
  2287.   
  2288.     d = DATASET.Database
  2289.   
  2290.     ' If we're working with a Dynaset, we don't need to configure
  2291.     ' controls
  2292.     If TypeOf DATASET Is Dynaset Then 
  2293.       FillSource.NextStep = Nothing
  2294.       FillSource.BtnNext.Enabled = False
  2295.       FillSource.BtnFinish.Enabled = True
  2296.     Else 
  2297.       FillSource.NextStep = Branch
  2298.       FillSource.BtnNext.Enabled = True
  2299.       FillSource.BtnFinish.Enabled = False
  2300.     End If
  2301.   
  2302.     FillSource.LBTable.Clear
  2303.     For i = 0 To d.TableCount - 1
  2304.       d.TableIndex = i
  2305.       FillSource.LBTable.InsertItem(d.TableName, d.TableIndex)
  2306.     Next i
  2307.     FillSource.LBTable.ListIndex = FillSource.LBTable.ItemIndex(DATASET.RecordSource)
  2308.   
  2309.     If (FillSource.LBTable.ListIndex <> -1 Or DATASET.RecordSource = "") Then 
  2310.       If (FillSource.LBTable.ListIndex = -1) Then FillSource.LBTable.ListIndex = 0
  2311.       FillSource.OBTable.Value = True
  2312.       FillSource.OBSQL.Value = False
  2313.     Else 
  2314.       FillSource.OBTable.Value = False
  2315.       FillSource.OBSQL.Value = True
  2316.     End If
  2317.   
  2318.   End Sub
  2319.  
  2320.   Sub FillSource_ValidateFinish(ok as Boolean)
  2321.     If TypeOf DATASET Is Dynaset Then 
  2322.       FillSource_ValidateNext(ok)
  2323.     Else 
  2324.       MessageBox.Message("Error", "You may not finish at this point unless the RecordSet in question is a Dynaset")
  2325.     End If
  2326.   End Sub
  2327.  
  2328.   Sub FillSource_ValidateNext(ok As Boolean)
  2329.     Try
  2330.       If (FillSource.OBTable.Value = True) Then 
  2331.         If (FillSource.LBTable.ListIndex <> -1) Then 
  2332.           DATASET.RecordSource = FillSource.LBTable.Text
  2333.           DATASET.Refresh
  2334.           ok = True
  2335.         Else 
  2336.           InfoBox.Message("Need selection", "You must first select a Table before continuing.")
  2337.           ok = False
  2338.         End If
  2339.       Else 
  2340.         DATASET.RecordSource = FillSource.TBSQL.Text
  2341.         DATASET.Refresh
  2342.         ok = True
  2343.       End If
  2344.     Catch
  2345.     End Try
  2346.   End Sub
  2347.  
  2348.   Function ExpandCtrlCharSequences(oldstr as string) as string
  2349.     Dim newstr, tempchar as string
  2350.     Dim I as integer
  2351.   
  2352.     ' The purpose of this function is to take a string with encoded control sequences
  2353.     ' and turn them into real control characters.  An encoded control character sequence
  2354.     ' is something like "^M", this is turned into Chr(13) in the return string.
  2355.  
  2356.     newstr = ""
  2357.     For I = 1 To Len(oldstr)
  2358.       If Mid$(oldstr, I, 1) = "^^" Then 
  2359.         tempchar = UCase(Mid$(oldstr, I + 1, 1))
  2360.         If tempchar >= "A" && tempchar <= "Z" Then 
  2361.           newstr = newstr & Chr(Asc(tempchar) - Asc("A") + 1)
  2362.           ' Advance the string past the next char, we used it.
  2363.           I = I + 1
  2364.         ElseIf tempchar = "^^" Then 
  2365.           ' Skip the first character of a "^^" sequence
  2366.         End If
  2367.       Else 
  2368.         newstr = newstr & Mid$(oldstr, I, 1)
  2369.       End If
  2370.     Next I
  2371.     ExpandCtrlCharSequences = newstr
  2372.   End Function
  2373.  
  2374.   Sub SelectFile_ValidateBack(ok As Boolean)
  2375.     ConnectString = SelectFile.TBFileName.Text
  2376.   End Sub
  2377.  
  2378.   Sub SelectFile_ValidateDisplay(ok As Boolean)
  2379.     SelectFile.BtnFinish.Enabled = False
  2380.     SelectFile.BtnCancel.Enabled = True
  2381.   
  2382.     If Not SelectFile.initialized Then 
  2383.       SelectFile.TBFileName.Clear
  2384.       SelectFile.initialized = True
  2385.     End If
  2386.   
  2387.     SelectFile.TBFileName.Text = ConnectString
  2388.     SelectFile.TBFileView.Clear
  2389.   
  2390.   End Sub
  2391.  
  2392.   Sub SelectFile_ValidateNext(ok As Boolean)
  2393.     ok = False
  2394.   
  2395.     If SelectFile.TBFileName.Text = "" Then 
  2396.       InfoBox.Message("Select File", "You must select a file name first")
  2397.       Exit Sub
  2398.     End If
  2399.   
  2400.   
  2401.     ConnectString = SelectFile.TBFileName.Text
  2402.   
  2403.     ok = True
  2404.   End Sub
  2405.  
  2406.   Sub SelectSource_ValidateDisplay(ok As Boolean)
  2407.     SelectSource.BtnFinish.Enabled = False
  2408.     SelectSource.BtnCancel.Enabled = True
  2409.   
  2410.     ok = SelectSource.UpdateListBoxes
  2411.   End Sub
  2412.  
  2413.   Sub SelectSource_ValidateNext(ok As Boolean)
  2414.     Dim SExTrp as New SuspendDebugExceptionTrapping
  2415.     If SelectSource.CBSource.Text <> "" Then 
  2416.       If Not StrComp(DATASET.Connect, SelectSource.CBSource.Text, 1) = 0 Then 
  2417.         Try
  2418.           DATASET.Connect = SelectSource.CBSource.Text
  2419.           ok = True
  2420.         Catch
  2421.           MessageBox.Message("Failed to Connect", "Could not connect to DataSource, please verify Connect string and try again")
  2422.           ok = False
  2423.         End Try
  2424.       End If
  2425.     Else 
  2426.       InfoBox.Message("Need selection", "Please select Data Source before continuing.")
  2427.       ok = False
  2428.     End If
  2429.   End Sub
  2430.  
  2431.   Sub StartStep_ValidateDisplay(ok As Boolean)
  2432.     With StartStep
  2433.       .BtnFinish.Enabled = False
  2434.       .BtnCancel.Enabled = True
  2435.       .OBJump.Enabled = CanModify
  2436.       .BtnWhackLayout.Visible = .OBJump.Enabled
  2437.  
  2438.       If Not .initialized Then 
  2439.         ConnectString = ""
  2440.         .OBJump.Value = False
  2441.         .initialized = True
  2442.       End If
  2443.    
  2444.       Select Case DATASET.DatabaseType
  2445.         Case "ODBC", "None"
  2446.           .OBODBC.Value = True
  2447.         Case "DelimitedAscii", "FixedAscii"
  2448.           If Len(DATASET.Connect) > 0 Then 
  2449.             ConnectString = DATASET.Connect
  2450.           End If
  2451.           .OBAscii.Value = True
  2452.       End Select
  2453.       ' If we can jump, set it as the default
  2454.       .OBJump.Value = .OBJump.Enabled
  2455.  
  2456.       ' If we can jump, set the appropriate references
  2457.       If .OBJump.Enabled Then FormMaker.SetReferences(DATASET)
  2458.  
  2459.     End With
  2460.   End Sub
  2461.  
  2462.   Sub StartStep_ValidateNext(ok As Boolean)
  2463.     With StartStep
  2464.       If .OBAscii.Value Then 
  2465.     ' Place info for Ascii NextStep
  2466.     .NextStep = SelectFile
  2467.       End If
  2468.  
  2469.       If .OBODBC.Value Then 
  2470.     ' Place info for ODBC NextStep
  2471.     .NextStep = SelectSource
  2472.       End If
  2473.  
  2474.       If (.OBODBC.Value || .OBAscii.Value) && .OBJump.Enabled then
  2475.         ' We're Editing, but the user DOESN'T want to modify existing layout
  2476.         Dim YNBX as New YesNoBox
  2477.         If YNBX.Message("Destroy old layout", "Envelop has already laid out a form based on this Recordset, the layout should be destroyed before altering the Recordset. Do you want to destroy the layout associated with the Recordset?") = IDYES then
  2478.           FormMaker.DestroyControls
  2479.         else
  2480.           ok = False
  2481.         End If
  2482.       End If
  2483.  
  2484.       If .OBJump.Value Then 
  2485.     .NextStep = ConfigureFields
  2486.       End If
  2487.     End With  
  2488.     ' Change database type if necessary
  2489.     With DATASET
  2490.       If StartStep.OBAscii.Value And (.DatabaseType = "ODBC" Or .DatabaseType = "None") Then 
  2491.         ' If changing to Ascii, presume delimited
  2492.         DATASET.DatabaseType = "DelimitedAscii"
  2493.       ElseIf StartStep.OBODBC.Value And .DatabaseType <> "ODBC" Then 
  2494.         DATASET.DatabaseType = "ODBC"
  2495.       End If
  2496.     End With
  2497.   End Sub
  2498.  
  2499.   Function TextUnload(ByVal indent As String, cmds As String) As Integer
  2500.     ' Write our parent's properties, but none of ours.
  2501.     TextUnload = False
  2502.   End Function
  2503.  
  2504. End Type
  2505.  
  2506. Begin Code
  2507. ' Reconstruction commands for object: DatabaseConstants
  2508. '
  2509.   With DatabaseConstants
  2510.     .DBC_READ_ONLY := 1
  2511.     .DBC_READ_WRITE := 2
  2512.     .DBC_LABEL := 3
  2513.     .DBC_NO_CHANGE := -2
  2514.     .DBC_ALL := 4
  2515.   End With  'DatabaseConstants
  2516.  
  2517. ' Reconstruction commands for object: DataBaseFormMaker
  2518. '
  2519.   With DataBaseFormMaker
  2520.     .CurrentY := 2175
  2521.     .Margin := 150
  2522.     .DBLblFont := Nothing
  2523.     .DBRWFont := Nothing
  2524.     .DBROFont := Nothing
  2525.     .LblBackColor := -1
  2526.     .LblForeColor := -1
  2527.     .DBROForeColor := -1
  2528.     .DBROBackColor := RGB(255, 255, 255)
  2529.     .DBRWBackColor := -1
  2530.     .DBRWForeColor := -1
  2531.     .LabelWidth := 1350
  2532.     .LabelHeight := 285
  2533.     .DBROMaxCharWidth := 195
  2534.     .DBRWMaxCharWidth := 195
  2535.     .HyperWidth := 8850
  2536.     With .FieldOptions
  2537.       .CanEdit := True
  2538.       .FieldName := ""
  2539.       .MaxLength := 0
  2540.       .Width := 0
  2541.       .Caption := ""
  2542.     End With  'DataBaseFormMaker.FieldOptions
  2543.     With .OptionGroup
  2544.     End With  'DataBaseFormMaker.OptionGroup
  2545.     With .DefaultFont
  2546.       .FaceName := "MS Sans Serif"
  2547.       .Size := 8.000000
  2548.       .Bold := False
  2549.       .Italic := False
  2550.       .Strikethru := False
  2551.     End With  'DataBaseFormMaker.DefaultFont
  2552.   End With  'DataBaseFormMaker
  2553.  
  2554. ' Reconstruction commands for object: QBEDataSourceName
  2555. '
  2556.   With QBEDataSourceName
  2557.     .Move(3720, 1815, 9075, 4305)
  2558.     .QueryObject := ODBC
  2559.     .Processing := 0
  2560.     .Canceled := 0
  2561.     With .DataSourceList
  2562.       .ZOrder := 1
  2563.       .Move(135, 585, 3480, 1950)
  2564.     End With  'QBEDataSourceName.DataSourceList
  2565.     With .CancelBttn
  2566.       .Caption := "Cancel"
  2567.       .ZOrder := 2
  2568.       .Move(6900, 1935, 1830, 600)
  2569.     End With  'QBEDataSourceName.CancelBttn
  2570.     With .ConnectButton
  2571.       .Caption := "Connect"
  2572.       .ZOrder := 3
  2573.       .Move(6900, 600, 1830, 600)
  2574.     End With  'QBEDataSourceName.ConnectButton
  2575.     With .TablesButton
  2576.       .Caption := "Browse Tables"
  2577.       .ZOrder := 4
  2578.       .Move(6900, 1260, 1830, 600)
  2579.     End With  'QBEDataSourceName.TablesButton
  2580.     With .TableList
  2581.       .ZOrder := 5
  2582.       .Move(3735, 585, 3150, 1950)
  2583.     End With  'QBEDataSourceName.TableList
  2584.     With .ConnectTextBox
  2585.       .ZOrder := 6
  2586.       .Move(2085, 3015, 5415, 420)
  2587.     End With  'QBEDataSourceName.ConnectTextBox
  2588.     With .ConnectLabel
  2589.       .Caption := "Connection String:"
  2590.       .ZOrder := 7
  2591.       .Move(105, 3075, 1830, 315)
  2592.     End With  'QBEDataSourceName.ConnectLabel
  2593.     With .DataSourceLabel
  2594.       .Caption := "Data Sources"
  2595.       .ZOrder := 8
  2596.       .Move(150, 150, 1500, 270)
  2597.     End With  'QBEDataSourceName.DataSourceLabel
  2598.     With .TableListLabel
  2599.       .Caption := "Available Tables"
  2600.       .ZOrder := 9
  2601.       .Move(3750, 150, 3000, 270)
  2602.     End With  'QBEDataSourceName.TableListLabel
  2603.   End With  'QBEDataSourceName
  2604. ' Reconstruction commands for object: QBETableData
  2605. '
  2606.   With QBETableData
  2607.     .Move(4095, 2535, 2040, 1755)
  2608.     .DB := Nothing
  2609.     With .FieldsList
  2610.       .Caption := "FieldsList"
  2611.       .BackColor := 12632256
  2612.       .ForeColor := 255
  2613.       .ZOrder := 2
  2614.       .Move(0, 360, 1920, 990)
  2615.     End With  'QBETableData.FieldsList
  2616.     With .TablesList
  2617.       .BackColor := 12632256
  2618.       .ForeColor := 16711808
  2619.       .ZOrder := 1
  2620.       .Move(0, 0, 1920, 360)
  2621.     End With  'QBETableData.TablesList
  2622.   End With  'QBETableData
  2623. ' Reconstruction commands for object: PickDatabaseDriver
  2624. '
  2625.   With PickDatabaseDriver
  2626.     .Caption := "Add Data Source"
  2627.     .Font := PickDatabaseDriver.EnvelopFont
  2628.     .Move(4305, 3780, 6030, 3300)
  2629.     .DefaultButton := PickDatabaseDriver.btnOK
  2630.     .CancelButton := PickDatabaseDriver.btnCancel
  2631.     With .btnOK
  2632.       .Caption := "OK"
  2633.       .ZOrder := 5
  2634.       .Move(4515, 150, 1275, 375)
  2635.     End With  'PickDatabaseDriver.btnOK
  2636.     With .btnCancel
  2637.       .Caption := "Cancel"
  2638.       .ZOrder := 4
  2639.       .Move(4515, 600, 1275, 375)
  2640.     End With  'PickDatabaseDriver.btnCancel
  2641.     With .lbDrivers
  2642.       .Caption := "lbDrivers"
  2643.       .ZOrder := 3
  2644.       .Move(225, 975, 4170, 1785)
  2645.     End With  'PickDatabaseDriver.lbDrivers
  2646.     With .Label1
  2647.       .Caption := "Select which ODBC driver you want to use from the list, then choose OK."
  2648.       .ZOrder := 2
  2649.       .Move(225, 75, 3525, 450)
  2650.     End With  'PickDatabaseDriver.Label1
  2651.     With .Label2
  2652.       .Caption := "Installed ODBC &Drivers:"
  2653.       .ZOrder := 1
  2654.       .Move(225, 675, 2400, 225)
  2655.     End With  'PickDatabaseDriver.Label2
  2656.     With .EnvelopFont
  2657.       .FaceName := "MS Sans Serif"
  2658.       .Size := 8.000000
  2659.       .Bold := True
  2660.       .Italic := False
  2661.       .Strikethru := False
  2662.     End With  'PickDatabaseDriver.EnvelopFont
  2663.   End With  'PickDatabaseDriver
  2664. ' Reconstruction commands for object: QBEFieldData
  2665. '
  2666.   With QBEFieldData
  2667.     .Move(6810, 3510, 2055, 2265)
  2668.     With .Table
  2669.       .BackColor := 12632256
  2670.       .ForeColor := 255
  2671.       .ZOrder := 5
  2672.       .Move(0, 0, 1935, 375)
  2673.       .BorderStyle := "Fixed Single"
  2674.       .Alignment := "Center"
  2675.     End With  'QBEFieldData.Table
  2676.     With .Field
  2677.       .BackColor := 12632256
  2678.       .ForeColor := 16711808
  2679.       .ZOrder := 4
  2680.       .Move(0, 375, 1935, 330)
  2681.       .BorderStyle := "Fixed Single"
  2682.       .Alignment := "Center"
  2683.     End With  'QBEFieldData.Field
  2684.     With .SortOrder
  2685.       .BackColor := 12632256
  2686.       .ZOrder := 3
  2687.       .Move(0, 705, 1935, 360)
  2688.     End With  'QBEFieldData.SortOrder
  2689.     With .CriteriaAnd
  2690.       .BackColor := 12632256
  2691.       .ZOrder := 2
  2692.       .Move(0, 1065, 1935, 390)
  2693.       .Alignment := "Center"
  2694.     End With  'QBEFieldData.CriteriaAnd
  2695.     With .CriteriaOr
  2696.       .BackColor := 12632256
  2697.       .ZOrder := 1
  2698.       .Move(0, 1455, 1935, 390)
  2699.       .Alignment := "Center"
  2700.     End With  'QBEFieldData.CriteriaOr
  2701.   End With  'QBEFieldData
  2702. ' Reconstruction commands for object: QBE
  2703. '
  2704.   With QBE
  2705.     .Move(2805, 4125, 11505, 6150)
  2706.     .Spacing := 100
  2707.     .DataConnection := Nothing
  2708.     .FieldsCount := 0
  2709.     .TablesCount := 0
  2710.     With .Execute
  2711.       .Caption := "Done"
  2712.       .ZOrder := 5
  2713.       .Move(10050, 5025, 1125, 345)
  2714.     End With  'QBE.Execute
  2715.     With .SQLText
  2716.       .ZOrder := 6
  2717.       .Move(735, 4530, 10440, 390)
  2718.       .WordWrap := True
  2719.       .MultiLine := True
  2720.       .ScrollBars := "Vertical"
  2721.     End With  'QBE.SQLText
  2722.     With .Dismiss
  2723.       .Caption := "Cancel"
  2724.       .ZOrder := 7
  2725.       .Move(135, 5010, 1110, 345)
  2726.     End With  'QBE.Dismiss
  2727.     With .LabelTable
  2728.       .Caption := "Table :"
  2729.       .ZOrder := 8
  2730.       .Move(60, 2265, 630, 210)
  2731.       .Alignment := "Right"
  2732.     End With  'QBE.LabelTable
  2733.     With .LabelField
  2734.       .Caption := "Field :"
  2735.       .ZOrder := 9
  2736.       .Move(60, 2580, 630, 285)
  2737.       .Alignment := "Right"
  2738.     End With  'QBE.LabelField
  2739.     With .LabelSort
  2740.       .Caption := "Sort :"
  2741.       .ZOrder := 10
  2742.       .Move(60, 2955, 630, 255)
  2743.       .Alignment := "Right"
  2744.     End With  'QBE.LabelSort
  2745.     With .LabelAnd
  2746.       .Caption := "And :"
  2747.       .ZOrder := 11
  2748.       .Move(60, 3330, 630, 270)
  2749.       .Alignment := "Right"
  2750.     End With  'QBE.LabelAnd
  2751.     With .LabelOr
  2752.       .Caption := "Or :"
  2753.       .ZOrder := 12
  2754.       .Move(60, 3735, 630, 285)
  2755.       .Alignment := "Right"
  2756.     End With  'QBE.LabelOr
  2757.     With .BuildSql
  2758.       .Caption := "SQL"
  2759.       .ZOrder := 13
  2760.       .Move(120, 4530, 615, 390)
  2761.     End With  'QBE.BuildSql
  2762.     With .DeleteTable
  2763.       .Caption := "Delete"
  2764.       .ZOrder := 14
  2765.       .Move(10335, 525, 855, 855)
  2766.       .BevelOuter := "Raised"
  2767.       .Picture := QBE.DeleteTable.pict
  2768.       With .pict
  2769.         .LoadType := "MemoryBased"
  2770.         .FileName := "dbtools.ero"
  2771.         .ResId := 0
  2772.       End With  'QBE.DeleteTable.pict
  2773.     End With  'QBE.DeleteTable
  2774.     With .TablesScroll
  2775.       .Caption := "TablesScroll"
  2776.       .ZOrder := 4
  2777.       .Move(75, 1740, 10230, 285)
  2778.       .Orientation := "Horizontal"
  2779.       .Move(75, 1740, 10230, 285)
  2780.       .OldValue := 0
  2781.     End With  'QBE.TablesScroll
  2782.     With .NewTable
  2783.       .Caption := "New"
  2784.       .ZOrder := 3
  2785.       .Move(10335, 105, 855, 345)
  2786.     End With  'QBE.NewTable
  2787.     With .TablesContainer
  2788.       .Caption := "TablesContainer"
  2789.       .ZOrder := 2
  2790.       .Move(60, 30, 9825, 1635)
  2791.       .BorderStyle := "None"
  2792.       .MaxButton := False
  2793.       .ControlBox := False
  2794.       .Parent := QBE
  2795.       .Visible := True
  2796.     End With  'QBE.TablesContainer
  2797.     With .FieldsContainer
  2798.       .Caption := "FieldsContainer"
  2799.       .ZOrder := 1
  2800.       .Move(855, 2160, 10215, 1920)
  2801.       .BorderStyle := "None"
  2802.       .MaxButton := False
  2803.       .ControlBox := False
  2804.       .Parent := QBE
  2805.       .Visible := True
  2806.     End With  'QBE.FieldsContainer
  2807.     With .FieldsScroll
  2808.       .Caption := "FieldsScroll"
  2809.       .ZOrder := 15
  2810.       .Move(735, 4140, 10440, 285)
  2811.       .Move(735, 4140, 10440, 285)
  2812.     End With  'QBE.FieldsScroll
  2813.   End With  'QBE
  2814. ' Reconstruction commands for object: DataConConfigureWizard
  2815. '
  2816.   With DataConConfigureWizard
  2817.     .GraphicFileName := "dbtools.ero"
  2818.     .FirstStep := DataConConfigureWizard.StartStep
  2819.     .LastStep := DataConConfigureWizard.ConfigCtrls
  2820.     With .Branch
  2821.       .Move(4290, 3300, 7155, 4815)
  2822.       .DefaultButton := DataConConfigureWizard.Branch.BtnNext
  2823.       .CancelButton := DataConConfigureWizard.Branch.BtnCancel
  2824.       .wizard := DataConConfigureWizard
  2825.       .NextStep := DataConConfigureWizard.ConfigCtrls
  2826.       .BackStep := DataConConfigureWizard.ConfigText
  2827.       .initialized := -1
  2828.       With .OBAuto
  2829.         .Caption := "Let Envelop do the layout"
  2830.         .ZOrder := 2
  2831.         .Move(2850, 1800, 3135, 300)
  2832.       End With  'DataConConfigureWizard.Branch.OBAuto
  2833.       With .OBManual
  2834.         .Caption := "Use existing controls"
  2835.         .ZOrder := 1
  2836.         .Move(2850, 1425, 3135, 300)
  2837.         .TabStop := True
  2838.         .Value := True
  2839.       End With  'DataConConfigureWizard.Branch.OBManual
  2840.       With .BtnFinish
  2841.         .ZOrder := 3
  2842.         .Enabled := False
  2843.         .Move(6165, 3990, 825, 300)
  2844.       End With  'DataConConfigureWizard.Branch.BtnFinish
  2845.       With .BtnNext
  2846.         .ZOrder := 4
  2847.         .Move(5265, 3990, 825, 300)
  2848.       End With  'DataConConfigureWizard.Branch.BtnNext
  2849.       With .BtnBack
  2850.         .ZOrder := 5
  2851.         .Move(4440, 3990, 825, 300)
  2852.       End With  'DataConConfigureWizard.Branch.BtnBack
  2853.       With .BtnCancel
  2854.         .ZOrder := 6
  2855.         .Enabled := False
  2856.         .Move(3540, 3990, 825, 300)
  2857.       End With  'DataConConfigureWizard.Branch.BtnCancel
  2858.       With .ImgGraphic
  2859.         .Move(300, 300, 2250, 3150)
  2860.         .Picture := DataConConfigureWizard.Bitmap
  2861.       End With  'DataConConfigureWizard.Branch.ImgGraphic
  2862.       With .LblInstruction
  2863.         .Caption := "Would you like to attach existing controls to the dataset, or let Envelop attempt to layout and configure controls. There will be a shortcut to this step from the first page of this wizard in the future."
  2864.         .ZOrder := 8
  2865.         .Move(2850, 225, 4065, 1050)
  2866.       End With  'DataConConfigureWizard.Branch.LblInstruction
  2867.       With .Frame1
  2868.         .ZOrder := 9
  2869.         .Move(75, 3765, 6915, 75)
  2870.       End With  'DataConConfigureWizard.Branch.Frame1
  2871.     End With  'DataConConfigureWizard.Branch
  2872.     With .ConfigureFields
  2873.       .Caption := "Configure Database for layout"
  2874.       .Move(3690, 4230, 7155, 4815)
  2875.       .DefaultButton := DataConConfigureWizard.ConfigureFields.BtnNext
  2876.       .CancelButton := DataConConfigureWizard.ConfigureFields.BtnCancel
  2877.       .wizard := DataConConfigureWizard
  2878.       .NextStep := DataConConfigureWizard.SetColors
  2879.       .BackStep := DataConConfigureWizard.SelectFields
  2880.       With .LBLFieldName7
  2881.         .ZOrder := 41
  2882.         .Move(3150, 3300, 1170, 300)
  2883.         .Visible := False
  2884.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName7
  2885.       With .TBFieldLabel7
  2886.         .ZOrder := 25
  2887.         .Move(4320, 3300, 975, 300)
  2888.         .Visible := False
  2889.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel7
  2890.       With .CHKField7
  2891.         .ZOrder := 26
  2892.         .Move(5400, 3300, 225, 300)
  2893.         .Visible := False
  2894.         .SuppressClicks = 0
  2895.       End With  'DataConConfigureWizard.ConfigureFields.CHKField7
  2896.       With .TBMaxChar7
  2897.         .ZOrder := 27
  2898.         .Move(5625, 3300, 630, 300)
  2899.         .Visible := False
  2900.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar7
  2901.       With .TBWidth7
  2902.         .ZOrder := 28
  2903.         .Move(6255, 3300, 630, 300)
  2904.         .Visible := False
  2905.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth7
  2906.       With .TBWidth1
  2907.         .Caption := "0"
  2908.         .ZOrder := 4
  2909.         .Move(6255, 1050, 630, 300)
  2910.         .Visible := True
  2911.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth1
  2912.       With .TBMaxChar1
  2913.         .Caption := "0"
  2914.         .ZOrder := 3
  2915.         .Move(5625, 1050, 630, 300)
  2916.         .Visible := True
  2917.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar1
  2918.       With .CHKField1
  2919.         .ZOrder := 2
  2920.         .Move(5400, 1050, 225, 300)
  2921.         .Visible := True
  2922.         .Value := "Checked"
  2923.       End With  'DataConConfigureWizard.ConfigureFields.CHKField1
  2924.       With .TBFieldLabel1
  2925.         .Caption := "First Name"
  2926.         .ZOrder := 1
  2927.         .Move(4320, 1050, 975, 300)
  2928.         .Visible := True
  2929.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel1
  2930.       With .LBLFieldName1
  2931.         .Caption := "First Name"
  2932.         .ZOrder := 40
  2933.         .Move(3150, 1050, 1170, 300)
  2934.         .Visible := True
  2935.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName1
  2936.       With .TBWidth2
  2937.         .Caption := "0"
  2938.         .ZOrder := 8
  2939.         .Move(6255, 1425, 630, 300)
  2940.         .Visible := True
  2941.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth2
  2942.       With .TBMaxChar2
  2943.         .Caption := "0"
  2944.         .ZOrder := 7
  2945.         .Move(5625, 1425, 630, 300)
  2946.         .Visible := True
  2947.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar2
  2948.       With .CHKField2
  2949.         .ZOrder := 6
  2950.         .Move(5400, 1425, 225, 300)
  2951.         .Visible := True
  2952.         .Value := "Checked"
  2953.       End With  'DataConConfigureWizard.ConfigureFields.CHKField2
  2954.       With .TBFieldLabel2
  2955.         .Caption := "Last Name"
  2956.         .ZOrder := 5
  2957.         .Move(4320, 1425, 975, 300)
  2958.         .Visible := True
  2959.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel2
  2960.       With .LBLFieldName2
  2961.         .Caption := "Last Name"
  2962.         .ZOrder := 39
  2963.         .Move(3150, 1425, 1170, 300)
  2964.         .Visible := True
  2965.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName2
  2966.       With .TBWidth3
  2967.         .Caption := "0"
  2968.         .ZOrder := 12
  2969.         .Move(6255, 1800, 630, 300)
  2970.         .Visible := True
  2971.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth3
  2972.       With .TBMaxChar3
  2973.         .Caption := "0"
  2974.         .ZOrder := 11
  2975.         .Move(5625, 1800, 630, 300)
  2976.         .Visible := True
  2977.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar3
  2978.       With .CHKField3
  2979.         .ZOrder := 10
  2980.         .Move(5400, 1800, 225, 300)
  2981.         .Visible := True
  2982.         .Value := "Checked"
  2983.       End With  'DataConConfigureWizard.ConfigureFields.CHKField3
  2984.       With .TBFieldLabel3
  2985.         .Caption := "Style"
  2986.         .ZOrder := 9
  2987.         .Move(4320, 1800, 975, 300)
  2988.         .Visible := True
  2989.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel3
  2990.       With .LBLFieldName3
  2991.         .Caption := "Style"
  2992.         .ZOrder := 38
  2993.         .Move(3150, 1800, 1170, 300)
  2994.         .Visible := True
  2995.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName3
  2996.       With .TBWidth4
  2997.         .Caption := "0"
  2998.         .ZOrder := 16
  2999.         .Move(6255, 2175, 630, 300)
  3000.         .Visible := True
  3001.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth4
  3002.       With .TBMaxChar4
  3003.         .Caption := "0"
  3004.         .ZOrder := 15
  3005.         .Move(5625, 2175, 630, 300)
  3006.         .Visible := True
  3007.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar4
  3008.       With .CHKField4
  3009.         .ZOrder := 14
  3010.         .Move(5400, 2175, 225, 300)
  3011.         .Visible := True
  3012.         .Value := "Checked"
  3013.       End With  'DataConConfigureWizard.ConfigureFields.CHKField4
  3014.       With .TBFieldLabel4
  3015.         .Caption := "Age"
  3016.         .ZOrder := 13
  3017.         .Move(4320, 2175, 975, 300)
  3018.         .Visible := True
  3019.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel4
  3020.       With .LBLFieldName4
  3021.         .Caption := "Age"
  3022.         .ZOrder := 37
  3023.         .Move(3150, 2175, 1170, 300)
  3024.         .Visible := True
  3025.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName4
  3026.       With .TBWidth5
  3027.         .Caption := "0"
  3028.         .ZOrder := 20
  3029.         .Move(6255, 2550, 630, 300)
  3030.         .Visible := True
  3031.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth5
  3032.       With .TBMaxChar5
  3033.         .Caption := "0"
  3034.         .ZOrder := 19
  3035.         .Move(5625, 2550, 630, 300)
  3036.         .Visible := True
  3037.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar5
  3038.       With .CHKField5
  3039.         .ZOrder := 18
  3040.         .Move(5400, 2550, 225, 300)
  3041.         .Visible := True
  3042.         .Value := "Checked"
  3043.       End With  'DataConConfigureWizard.ConfigureFields.CHKField5
  3044.       With .TBFieldLabel5
  3045.         .Caption := "Sex"
  3046.         .ZOrder := 17
  3047.         .Move(4320, 2550, 975, 300)
  3048.         .Visible := True
  3049.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel5
  3050.       With .LBLFieldName5
  3051.         .Caption := "Sex"
  3052.         .ZOrder := 36
  3053.         .Move(3150, 2550, 1170, 300)
  3054.         .Visible := True
  3055.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName5
  3056.       With .TBWidth6
  3057.         .Caption := "0"
  3058.         .ZOrder := 24
  3059.         .Move(6255, 2925, 630, 300)
  3060.         .Visible := True
  3061.       End With  'DataConConfigureWizard.ConfigureFields.TBWidth6
  3062.       With .TBMaxChar6
  3063.         .Caption := "0"
  3064.         .ZOrder := 23
  3065.         .Move(5625, 2925, 630, 300)
  3066.         .Visible := True
  3067.       End With  'DataConConfigureWizard.ConfigureFields.TBMaxChar6
  3068.       With .CHKField6
  3069.         .ZOrder := 22
  3070.         .Move(5400, 2925, 225, 300)
  3071.         .Visible := True
  3072.         .Value := "Checked"
  3073.       End With  'DataConConfigureWizard.ConfigureFields.CHKField6
  3074.       With .TBFieldLabel6
  3075.         .Caption := "Status"
  3076.         .ZOrder := 21
  3077.         .Move(4320, 2925, 975, 300)
  3078.         .Visible := True
  3079.       End With  'DataConConfigureWizard.ConfigureFields.TBFieldLabel6
  3080.       With .LBLFieldName6
  3081.         .Caption := "Status"
  3082.         .ZOrder := 35
  3083.         .Move(3150, 2925, 1170, 300)
  3084.         .Visible := True
  3085.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldName6
  3086.       With .ScrollBar1
  3087.         .Caption := "ScrollBar1"
  3088.         .ZOrder := 34
  3089.         .Move(2850, 990, 225, 2670)
  3090.         .SmallChange := 1
  3091.         .LargeChange := 6
  3092.         .Max := 0
  3093.       End With  'DataConConfigureWizard.ConfigureFields.ScrollBar1
  3094.       With .LBLCanEditHeading
  3095.         .Caption := "Can Edit"
  3096.         .ZOrder := 33
  3097.         .Move(5250, 525, 375, 450)
  3098.       End With  'DataConConfigureWizard.ConfigureFields.LBLCanEditHeading
  3099.       With .LBLCaptionHeading
  3100.         .Caption := "Caption"
  3101.         .ZOrder := 32
  3102.         .Move(4350, 750, 900, 225)
  3103.         .Alignment := "Center"
  3104.       End With  'DataConConfigureWizard.ConfigureFields.LBLCaptionHeading
  3105.       With .LBLFieldHeading
  3106.         .Caption := "Field"
  3107.         .ZOrder := 31
  3108.         .Move(3150, 750, 1200, 225)
  3109.         .Alignment := "Center"
  3110.       End With  'DataConConfigureWizard.ConfigureFields.LBLFieldHeading
  3111.       With .LBLWidthHeading
  3112.         .Caption := "Width"
  3113.         .ZOrder := 30
  3114.         .Move(6225, 750, 675, 225)
  3115.         .Alignment := "Center"
  3116.       End With  'DataConConfigureWizard.ConfigureFields.LBLWidthHeading
  3117.       With .LBLMaxCharHeading
  3118.         .Caption := "Max Char"
  3119.         .ZOrder := 29
  3120.         .Move(5625, 525, 600, 450)
  3121.         .Alignment := "Center"
  3122.       End With  'DataConConfigureWizard.ConfigureFields.LBLMaxCharHeading
  3123.       With .ColumnGroup
  3124.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName1)
  3125.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName2)
  3126.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName3)
  3127.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName4)
  3128.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName5)
  3129.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName6)
  3130.         .Append(DataConConfigureWizard.ConfigureFields.LBLFieldName7)
  3131.       End With  'DataConConfigureWizard.ConfigureFields.ColumnGroup
  3132.       With .Frame2
  3133.         .ZOrder := 49
  3134.         .Move(3075, 900, 3885, 2775)
  3135.       End With  'DataConConfigureWizard.ConfigureFields.Frame2
  3136.       With .BtnFinish
  3137.         .ZOrder := 42
  3138.         .Move(6165, 3990, 825, 300)
  3139.       End With  'DataConConfigureWizard.ConfigureFields.BtnFinish
  3140.       With .BtnNext
  3141.         .ZOrder := 43
  3142.         .Move(5265, 3990, 825, 300)
  3143.       End With  'DataConConfigureWizard.ConfigureFields.BtnNext
  3144.       With .BtnBack
  3145.         .ZOrder := 44
  3146.         .Move(4440, 3990, 825, 300)
  3147.       End With  'DataConConfigureWizard.ConfigureFields.BtnBack
  3148.       With .BtnCancel
  3149.         .ZOrder := 45
  3150.         .Move(3540, 3990, 825, 300)
  3151.       End With  'DataConConfigureWizard.ConfigureFields.BtnCancel
  3152.       With .ImgGraphic
  3153.         .ZOrder := 46
  3154.         .Move(225, 225, 2475, 3150)
  3155.         .Picture := DataConConfigureWizard.Bitmap
  3156.       End With  'DataConConfigureWizard.ConfigureFields.ImgGraphic
  3157.       With .LblInstruction
  3158.         .Caption := "Configure the selected fields here."
  3159.         .ZOrder := 47
  3160.         .Move(2850, 225, 4065, 225)
  3161.       End With  'DataConConfigureWizard.ConfigureFields.LblInstruction
  3162.       With .Frame1
  3163.         .ZOrder := 48
  3164.         .Move(75, 3765, 6915, 75)
  3165.       End With  'DataConConfigureWizard.ConfigureFields.Frame1
  3166.     End With  'DataConConfigureWizard.ConfigureFields
  3167.     With .SelectFields
  3168.       .Caption := "Configure Database for layout"
  3169.       .Move(5610, 2115, 7230, 4785)
  3170.       .DefaultButton := DataConConfigureWizard.SelectFields.BtnNext
  3171.       .CancelButton := DataConConfigureWizard.SelectFields.BtnCancel
  3172.       .wizard := DataConConfigureWizard
  3173.       .NextStep := DataConConfigureWizard.ConfigureFields
  3174.       .BackStep := DataConConfigureWizard.Branch
  3175.       With .LBFieldList
  3176.         .Caption := "LBFieldList"
  3177.         .ZOrder := 8
  3178.         .Move(2850, 1200, 1350, 2370)
  3179.         .Sorted := False
  3180.         .IntegralHeight := False
  3181.       End With  'DataConConfigureWizard.SelectFields.LBFieldList
  3182.       With .LBSelFields
  3183.         .Caption := "LBSelFields"
  3184.         .ZOrder := 7
  3185.         .Move(5550, 1200, 1350, 2370)
  3186.         .Sorted := False
  3187.         .IntegralHeight := False
  3188.       End With  'DataConConfigureWizard.SelectFields.LBSelFields
  3189.       With .BTNAddAll
  3190.         .Caption := "Add All ->"
  3191.         .ZOrder := 6
  3192.         .Move(4350, 1275, 1050, 450)
  3193.       End With  'DataConConfigureWizard.SelectFields.BTNAddAll
  3194.       With .BTNAdd
  3195.         .Caption := "Add ->"
  3196.         .ZOrder := 5
  3197.         .Move(4350, 1875, 1050, 450)
  3198.       End With  'DataConConfigureWizard.SelectFields.BTNAdd
  3199.       With .BTNRemove
  3200.         .Caption := "<- Remove"
  3201.         .ZOrder := 4
  3202.         .Move(4350, 2475, 1050, 450)
  3203.       End With  'DataConConfigureWizard.SelectFields.BTNRemove
  3204.       With .BTNRemoveAll
  3205.         .Caption := "<- Clear All"
  3206.         .ZOrder := 3
  3207.         .Move(4350, 3075, 1050, 450)
  3208.       End With  'DataConConfigureWizard.SelectFields.BTNRemoveAll
  3209.       With .LBLInclude
  3210.         .Caption := "Selected Fields"
  3211.         .ZOrder := 2
  3212.         .Move(5550, 900, 1350, 225)
  3213.         .Alignment := "Center"
  3214.       End With  'DataConConfigureWizard.SelectFields.LBLInclude
  3215.       With .LBLAllFields
  3216.         .Caption := "Field List"
  3217.         .ZOrder := 1
  3218.         .Move(2850, 900, 1350, 225)
  3219.         .Alignment := "Center"
  3220.       End With  'DataConConfigureWizard.SelectFields.LBLAllFields
  3221.       With .BtnFinish
  3222.         .ZOrder := 9
  3223.         .Move(6165, 3990, 825, 300)
  3224.       End With  'DataConConfigureWizard.SelectFields.BtnFinish
  3225.       With .BtnNext
  3226.         .ZOrder := 10
  3227.         .Move(5265, 3990, 825, 300)
  3228.       End With  'DataConConfigureWizard.SelectFields.BtnNext
  3229.       With .BtnBack
  3230.         .Enabled := False
  3231.         .ZOrder := 11
  3232.         .Move(4440, 3990, 825, 300)
  3233.       End With  'DataConConfigureWizard.SelectFields.BtnBack
  3234.       With .BtnCancel
  3235.         .ZOrder := 12
  3236.         .Move(3540, 3990, 825, 300)
  3237.       End With  'DataConConfigureWizard.SelectFields.BtnCancel
  3238.       With .ImgGraphic
  3239.         .ZOrder := 13
  3240.         .Move(225, 225, 2475, 3150)
  3241.         .Picture := DataConConfigureWizard.Bitmap
  3242.       End With  'DataConConfigureWizard.SelectFields.ImgGraphic
  3243.       With .LblInstruction
  3244.         .Caption := "Select the fields to include in the layout. The order of the fields in the selected list box will be the order in which the fields will be laid out."
  3245.         .ZOrder := 14
  3246.         .Move(2850, 225, 4065, 600)
  3247.       End With  'DataConConfigureWizard.SelectFields.LblInstruction
  3248.       With .Frame1
  3249.         .ZOrder := 15
  3250.         .Move(75, 3765, 6915, 75)
  3251.       End With  'DataConConfigureWizard.SelectFields.Frame1
  3252.     End With  'DataConConfigureWizard.SelectFields
  3253.     With .SetColors
  3254.       .Caption := "Configure Database for layout"
  3255.       .Move(3690, 4230, 7155, 4815)
  3256.       .DefaultButton := DataConConfigureWizard.SetColors.BtnFinish
  3257.       .CancelButton := DataConConfigureWizard.SetColors.BtnCancel
  3258.       .wizard := DataConConfigureWizard
  3259.       .BackStep := DataConConfigureWizard.ConfigureFields
  3260.       .initialized := -1
  3261.       With .FieldReadOnly
  3262.         .Caption := "Read Only:"
  3263.         .ForeColor := 16711680
  3264.         .ZOrder := 18
  3265.         .Move(2850, 975, 1200, 300)
  3266.         .Alignment := "Right"
  3267.       End With  'DataConConfigureWizard.SetColors.FieldReadOnly
  3268.       With .TBReadOnly
  3269.         .Caption := "D. Gagne"
  3270.         .BackColor := 12632256
  3271.         .ZOrder := 17
  3272.         .Move(4125, 975, 2700, 300)
  3273.       End With  'DataConConfigureWizard.SetColors.TBReadOnly
  3274.       With .TBReadWrite
  3275.         .Caption := "Active"
  3276.         .BackColor := 12615808
  3277.         .ZOrder := 14
  3278.         .Move(4125, 1725, 2700, 300)
  3279.       End With  'DataConConfigureWizard.SetColors.TBReadWrite
  3280.       With .FieldReadWrite
  3281.         .Caption := "Editable:"
  3282.         .ForeColor := 16711680
  3283.         .ZOrder := 15
  3284.         .Move(2850, 1725, 1200, 300)
  3285.         .Alignment := "Right"
  3286.       End With  'DataConConfigureWizard.SetColors.FieldReadWrite
  3287.       With .LBLNotice
  3288.         .Caption := "All controls will be sized to fit requested font"
  3289.         .ZOrder := 13
  3290.         .Move(2775, 2100, 4050, 225)
  3291.       End With  'DataConConfigureWizard.SetColors.LBLNotice
  3292.       With .BTNSetROBack
  3293.         .Caption := "BackColor"
  3294.         .ZOrder := 12
  3295.         .Move(3750, 2475, 1020, 300)
  3296.       End With  'DataConConfigureWizard.SetColors.BTNSetROBack
  3297.       With .BTNSetROFore
  3298.         .Caption := "ForeColor"
  3299.         .ZOrder := 11
  3300.         .Move(4770, 2475, 1020, 300)
  3301.       End With  'DataConConfigureWizard.SetColors.BTNSetROFore
  3302.       With .BTNSetROFont
  3303.         .Caption := "Font"
  3304.         .ZOrder := 10
  3305.         .Move(5790, 2475, 1020, 300)
  3306.       End With  'DataConConfigureWizard.SetColors.BTNSetROFont
  3307.       With .BTNSetRWFont
  3308.         .Caption := "Font"
  3309.         .ZOrder := 7
  3310.         .Move(5790, 2850, 1020, 300)
  3311.       End With  'DataConConfigureWizard.SetColors.BTNSetRWFont
  3312.       With .BTNSetRWFore
  3313.         .Caption := "ForeColor"
  3314.         .ZOrder := 8
  3315.         .Move(4770, 2850, 1020, 300)
  3316.       End With  'DataConConfigureWizard.SetColors.BTNSetRWFore
  3317.       With .BTNSetRWBack
  3318.         .Caption := "BackColor"
  3319.         .ZOrder := 9
  3320.         .Move(3750, 2850, 1020, 300)
  3321.       End With  'DataConConfigureWizard.SetColors.BTNSetRWBack
  3322.       With .BTNSetLBLFont
  3323.         .Caption := "Font"
  3324.         .ZOrder := 4
  3325.         .Move(5790, 3225, 1020, 300)
  3326.       End With  'DataConConfigureWizard.SetColors.BTNSetLBLFont
  3327.       With .BTNSetLBLFore
  3328.         .Caption := "ForeColor"
  3329.         .ZOrder := 5
  3330.         .Move(4770, 3225, 1020, 300)
  3331.       End With  'DataConConfigureWizard.SetColors.BTNSetLBLFore
  3332.       With .BTNSetLBLBack
  3333.         .Caption := "BackColor"
  3334.         .ZOrder := 6
  3335.         .Move(3750, 3225, 1020, 300)
  3336.       End With  'DataConConfigureWizard.SetColors.BTNSetLBLBack
  3337.       With .LBLSetRO
  3338.         .Caption := "Read Only"
  3339.         .ZOrder := 3
  3340.         .Move(2775, 2475, 975, 300)
  3341.       End With  'DataConConfigureWizard.SetColors.LBLSetRO
  3342.       With .LBLSetRW
  3343.         .Caption := "Editable"
  3344.         .ZOrder := 2
  3345.         .Move(2775, 2850, 975, 300)
  3346.       End With  'DataConConfigureWizard.SetColors.LBLSetRW
  3347.       With .LBLSetLabel
  3348.         .Caption := "Labels"
  3349.         .ZOrder := 1
  3350.         .Move(2775, 3225, 975, 300)
  3351.       End With  'DataConConfigureWizard.SetColors.LBLSetLabel
  3352.       With .ColorDlg
  3353.         .Color := 12615808
  3354.       End With  'DataConConfigureWizard.SetColors.ColorDlg
  3355.       With .BtnFinish
  3356.         .ZOrder := 20
  3357.         .Move(6165, 3990, 825, 300)
  3358.       End With  'DataConConfigureWizard.SetColors.BtnFinish
  3359.       With .BtnNext
  3360.         .Enabled := False
  3361.         .ZOrder := 21
  3362.         .Move(5265, 3990, 825, 300)
  3363.       End With  'DataConConfigureWizard.SetColors.BtnNext
  3364.       With .BtnBack
  3365.         .ZOrder := 22
  3366.         .Move(4440, 3990, 825, 300)
  3367.       End With  'DataConConfigureWizard.SetColors.BtnBack
  3368.       With .BtnCancel
  3369.         .ZOrder := 23
  3370.         .Move(3540, 3990, 825, 300)
  3371.       End With  'DataConConfigureWizard.SetColors.BtnCancel
  3372.       With .ImgGraphic
  3373.         .ZOrder := 24
  3374.         .Move(225, 225, 2475, 3150)
  3375.         .Picture := DataConConfigureWizard.Bitmap
  3376.       End With  'DataConConfigureWizard.SetColors.ImgGraphic
  3377.       With .LblInstruction
  3378.         .Caption := "Choose the colors and fonts for the layout."
  3379.         .ZOrder := 25
  3380.         .Move(2850, 225, 4065, 225)
  3381.       End With  'DataConConfigureWizard.SetColors.LblInstruction
  3382.       With .Frame1
  3383.         .ZOrder := 26
  3384.         .Move(75, 3765, 6915, 75)
  3385.       End With  'DataConConfigureWizard.SetColors.Frame1
  3386.     End With  'DataConConfigureWizard.SetColors
  3387.     With .SelectSource
  3388.       .Caption := "Configure DataControl"
  3389.       .Move(4080, 2280, 7230, 4785)
  3390.       .DefaultButton := DataConConfigureWizard.SelectSource.BtnNext
  3391.       .CancelButton := DataConConfigureWizard.SelectSource.BtnCancel
  3392.       .wizard := DataConConfigureWizard
  3393.       .NextStep := DataConConfigureWizard.FillSource
  3394.       .BackStep := DataConConfigureWizard.StartStep
  3395.       With .CBSource
  3396.         .ZOrder := 1
  3397.         .Move(2850, 1200, 4050, 300)
  3398.       End With  'DataConConfigureWizard.SelectSource.CBSource
  3399.       With .BTNModify
  3400.         .Caption := "Modify..."
  3401.         .ZOrder := 2
  3402.         .Move(5550, 1650, 1350, 300)
  3403.       End With  'DataConConfigureWizard.SelectSource.BTNModify
  3404.       With .BTNNew
  3405.         .Caption := "New..."
  3406.         .ZOrder := 3
  3407.         .Move(2850, 1650, 1350, 300)
  3408.       End With  'DataConConfigureWizard.SelectSource.BTNNew
  3409.       With .BtnFinish
  3410.         .Enabled := False
  3411.         .ZOrder := 9
  3412.         .Move(6300, 4020, 825, 300)
  3413.       End With  'DataConConfigureWizard.SelectSource.BtnFinish
  3414.       With .BtnNext
  3415.         .ZOrder := 4
  3416.         .Move(5400, 4020, 825, 300)
  3417.       End With  'DataConConfigureWizard.SelectSource.BtnNext
  3418.       With .BtnBack
  3419.         .ZOrder := 5
  3420.         .Move(4575, 4020, 825, 300)
  3421.       End With  'DataConConfigureWizard.SelectSource.BtnBack
  3422.       With .BtnCancel
  3423.         .ZOrder := 6
  3424.         .Move(3675, 4020, 825, 300)
  3425.       End With  'DataConConfigureWizard.SelectSource.BtnCancel
  3426.       With .ImgGraphic
  3427.         .ZOrder := 10
  3428.         .Move(300, 300, 2250, 3150)
  3429.         .Picture := DataConConfigureWizard.Bitmap
  3430.       End With  'DataConConfigureWizard.SelectSource.ImgGraphic
  3431.       With .LblInstruction
  3432.         .Caption := "Which Data Source would you like to use? Include any special parameters or Connect string arguments."
  3433.         .ZOrder := 7
  3434.         .Move(2850, 300, 4200, 750)
  3435.       End With  'DataConConfigureWizard.SelectSource.LblInstruction
  3436.       With .Frame1
  3437.         .ZOrder := 8
  3438.         .Move(75, 3795, 7050, 75)
  3439.       End With  'DataConConfigureWizard.SelectSource.Frame1
  3440.     End With  'DataConConfigureWizard.SelectSource
  3441.     With .FillSource
  3442.       .Caption := "Configure DataControl"
  3443.       .Move(5610, 2115, 7230, 4785)
  3444.       .DefaultButton := DataConConfigureWizard.FillSource.BtnNext
  3445.       .CancelButton := Nothing
  3446.       .wizard := DataConConfigureWizard
  3447.       .NextStep := DataConConfigureWizard.Branch
  3448.       .BackStep := DataConConfigureWizard.SelectSource
  3449.       With .LBTable
  3450.         .Caption := "LBTable"
  3451.         .ZOrder := 4
  3452.         .Move(2850, 1050, 4050, 1005)
  3453.       End With  'DataConConfigureWizard.FillSource.LBTable
  3454.       With .OBTable
  3455.         .Caption := "Use Table"
  3456.         .ZOrder := 3
  3457.         .Move(2850, 750, 2145, 225)
  3458.         .TabStop := True
  3459.       End With  'DataConConfigureWizard.FillSource.OBTable
  3460.       With .OBSQL
  3461.         .Caption := "Use SQL"
  3462.         .ZOrder := 2
  3463.         .Move(2850, 2250, 2145, 225)
  3464.       End With  'DataConConfigureWizard.FillSource.OBSQL
  3465.       With .TBSQL
  3466.         .ZOrder := 1
  3467.         .Move(2850, 2550, 4050, 1050)
  3468.         .WordWrap := True
  3469.         .MultiLine := True
  3470.         .ScrollBars := "Vertical"
  3471.       End With  'DataConConfigureWizard.FillSource.TBSQL
  3472.       With .BtnFinish
  3473.         .Enabled := False
  3474.         .ZOrder := 5
  3475.         .Move(6300, 4020, 825, 300)
  3476.       End With  'DataConConfigureWizard.FillSource.BtnFinish
  3477.       With .BtnNext
  3478.         .ZOrder := 6
  3479.         .Move(5400, 4020, 825, 300)
  3480.       End With  'DataConConfigureWizard.FillSource.BtnNext
  3481.       With .BtnBack
  3482.         .ZOrder := 7
  3483.         .Move(4575, 4020, 825, 300)
  3484.       End With  'DataConConfigureWizard.FillSource.BtnBack
  3485.       With .BtnCancel
  3486.         .ZOrder := 8
  3487.         .Move(3675, 4020, 825, 300)
  3488.       End With  'DataConConfigureWizard.FillSource.BtnCancel
  3489.       With .ImgGraphic
  3490.         .ZOrder := 9
  3491.         .Move(300, 300, 2250, 3150)
  3492.         .Picture := DataConConfigureWizard.Bitmap
  3493.       End With  'DataConConfigureWizard.FillSource.ImgGraphic
  3494.       With .LblInstruction
  3495.         .Caption := "How would you like to fill in the Source?"
  3496.         .ZOrder := 10
  3497.         .Move(2850, 300, 4200, 300)
  3498.       End With  'DataConConfigureWizard.FillSource.LblInstruction
  3499.       With .Frame1
  3500.         .ZOrder := 11
  3501.         .Move(75, 3795, 7050, 75)
  3502.       End With  'DataConConfigureWizard.FillSource.Frame1
  3503.     End With  'DataConConfigureWizard.FillSource
  3504.     With .StartStep
  3505.       .Caption := "Configure DataControl"
  3506.       .Move(5610, 2115, 7230, 4785)
  3507.       .DefaultButton := DataConConfigureWizard.StartStep.BtnNext
  3508.       .CancelButton := Nothing
  3509.       .wizard := DataConConfigureWizard
  3510.       .NextStep := DataConConfigureWizard.SelectSource
  3511.       .initialized := -1
  3512.       .ObjRef := Nothing
  3513.       With .OBAscii
  3514.         .Caption := "Ascii text file"
  3515.         .ZOrder := 4
  3516.         .Move(3240, 1725, 3525, 630)
  3517.       End With  'DataConConfigureWizard.StartStep.OBAscii
  3518.       With .OBODBC
  3519.         .Caption := "ODBC database"
  3520.         .ZOrder := 3
  3521.         .Move(3240, 1020, 3525, 630)
  3522.         .TabStop := True
  3523.         .Value := True
  3524.       End With  'DataConConfigureWizard.StartStep.OBODBC
  3525.       With .OBJump
  3526.         .Caption := "Modify existing layout properties"
  3527.         .ZOrder := 2
  3528.         .Move(3225, 2505, 3525, 630)
  3529.         .TabStop := True
  3530.         .Value := True
  3531.       End With  'DataConConfigureWizard.StartStep.OBJump
  3532.       With .BtnWhackLayout
  3533.         .Caption := "Destroy Existing Layout"
  3534.         .ZOrder := 1
  3535.         .Move(3525, 3000, 2700, 300)
  3536.       End With
  3537.       With .BtnFinish
  3538.         .Enabled := False
  3539.         .ZOrder := 5
  3540.         .Move(6300, 4020, 825, 300)
  3541.       End With  'DataConConfigureWizard.StartStep.BtnFinish
  3542.       With .BtnNext
  3543.         .ZOrder := 6
  3544.         .Move(5400, 4020, 825, 300)
  3545.       End With  'DataConConfigureWizard.StartStep.BtnNext
  3546.       With .BtnBack
  3547.         .Enabled := False
  3548.         .ZOrder := 7
  3549.         .Move(4575, 4020, 825, 300)
  3550.       End With  'DataConConfigureWizard.StartStep.BtnBack
  3551.       With .BtnCancel
  3552.         .ZOrder := 8
  3553.         .Move(3675, 4020, 825, 300)
  3554.       End With  'DataConConfigureWizard.StartStep.BtnCancel
  3555.       With .ImgGraphic
  3556.         .ZOrder := 9
  3557.         .Move(300, 300, 2250, 3150)
  3558.         .Picture := DataConConfigureWizard.Bitmap
  3559.       End With  'DataConConfigureWizard.StartStep.ImgGraphic
  3560.       With .LblInstruction
  3561.         .Caption := "Select which type of data to use."
  3562.         .ZOrder := 10
  3563.         .Move(2805, 225, 4245, 300)
  3564.       End With  'DataConConfigureWizard.StartStep.LblInstruction
  3565.       With .Frame1
  3566.         .ZOrder := 11
  3567.         .Move(75, 3795, 7050, 75)
  3568.       End With  'DataConConfigureWizard.StartStep.Frame1
  3569.     End With  'DataConConfigureWizard.StartStep
  3570.     With .ConfigText
  3571.       .Caption := "Configure DataControl"
  3572.       .Move(5610, 2115, 7230, 4785)
  3573.       .DefaultButton := DataConConfigureWizard.ConfigText.BtnNext
  3574.       .CancelButton := Nothing
  3575.       .wizard := DataConConfigureWizard
  3576.       .NextStep := DataConConfigureWizard.Branch
  3577.       .BackStep := DataConConfigureWizard.SelectFile
  3578.       With .CHKFirstLine
  3579.         .Caption := "First line as Field names"
  3580.         .ZOrder := 15
  3581.         .Move(2925, 900, 3165, 300)
  3582.       End With  'DataConConfigureWizard.ConfigText.CHKFirstLine
  3583.       With .OBDelim
  3584.         .Caption := "DelimitedAscii File"
  3585.         .ZOrder := 14
  3586.         .Move(2925, 1500, 1905, 300)
  3587.       End With  'DataConConfigureWizard.ConfigText.OBDelim
  3588.       With .OBFixed
  3589.         .Caption := "FixedAscii File"
  3590.         .ZOrder := 13
  3591.         .Move(2925, 1800, 3450, 300)
  3592.         .TabStop := True
  3593.       End With  'DataConConfigureWizard.ConfigText.OBFixed
  3594.       With .LBLFieldDelim
  3595.         .Caption := "Field Delimiter"
  3596.         .ZOrder := 12
  3597.         .Move(2775, 2925, 2235, 225)
  3598.         .Visible := False
  3599.       End With  'DataConConfigureWizard.ConfigText.LBLFieldDelim
  3600.       With .TBFieldDelim
  3601.         .Caption := "Field Delimiter"
  3602.         .ZOrder := 11
  3603.         .Move(5175, 2925, 1725, 300)
  3604.         .Visible := False
  3605.       End With  'DataConConfigureWizard.ConfigText.TBFieldDelim
  3606.       With .LBLNumFields
  3607.         .Caption := "Number of fields"
  3608.         .ZOrder := 10
  3609.         .Move(2775, 2250, 1635, 165)
  3610.       End With  'DataConConfigureWizard.ConfigText.LBLNumFields
  3611.       With .LBLFieldWidth
  3612.         .Caption := "Field widths"
  3613.         .ZOrder := 9
  3614.         .Move(2775, 2775, 1635, 165)
  3615.       End With  'DataConConfigureWizard.ConfigText.LBLFieldWidth
  3616.       With .TBNumFields
  3617.         .Caption := "Number Of Fields"
  3618.         .ZOrder := 8
  3619.         .Move(4575, 2175, 2325, 375)
  3620.       End With  'DataConConfigureWizard.ConfigText.TBNumFields
  3621.       With .TBFieldWidth
  3622.         .Caption := "FieldWidth"
  3623.         .ZOrder := 7
  3624.         .Move(4575, 2775, 2325, 450)
  3625.       End With  'DataConConfigureWizard.ConfigText.TBFieldWidth
  3626.       With .TBRowDelim
  3627.         .Caption := "RowDelimiter"
  3628.         .ZOrder := 5
  3629.         .Move(5175, 2175, 1725, 300)
  3630.         .Visible := False
  3631.       End With  'DataConConfigureWizard.ConfigText.TBRowDelim
  3632.       With .LBLRowDelim
  3633.         .Caption := "Row Delimiter"
  3634.         .ZOrder := 6
  3635.         .Move(2775, 2175, 2235, 225)
  3636.         .Visible := False
  3637.         .WordWrap := False
  3638.       End With  'DataConConfigureWizard.ConfigText.LBLRowDelim
  3639.       With .TBRowDelimXpr
  3640.         .Caption := "RowDelimiter Expression"
  3641.         .ZOrder := 3
  3642.         .Move(5175, 2550, 1725, 300)
  3643.         .Visible := False
  3644.       End With  'DataConConfigureWizard.ConfigText.TBRowDelimXpr
  3645.       With .LBLRowDelimXpr
  3646.         .Caption := "Row Delimiter Expression"
  3647.         .ZOrder := 4
  3648.         .Move(2775, 2550, 2235, 225)
  3649.         .Visible := False
  3650.         .WordWrap := False
  3651.       End With  'DataConConfigureWizard.ConfigText.LBLRowDelimXpr
  3652.       With .TBFieldDelimXpr
  3653.         .Caption := "FieldDelimiter Expression"
  3654.         .ZOrder := 1
  3655.         .Move(5175, 3300, 1725, 300)
  3656.         .Visible := False
  3657.       End With  'DataConConfigureWizard.ConfigText.TBFieldDelimXpr
  3658.       With .LBLFieldDelimXpr
  3659.         .Caption := "Field Delimiter Expression"
  3660.         .ZOrder := 2
  3661.         .Move(2775, 3300, 2235, 225)
  3662.         .Visible := False
  3663.         .WordWrap := False
  3664.       End With  'DataConConfigureWizard.ConfigText.LBLFieldDelimXpr
  3665.       With .BtnFinish
  3666.         .Enabled := False
  3667.         .ZOrder := 16
  3668.         .Move(6300, 4020, 825, 300)
  3669.       End With  'DataConConfigureWizard.ConfigText.BtnFinish
  3670.       With .BtnNext
  3671.         .ZOrder := 17
  3672.         .Move(5400, 4020, 825, 300)
  3673.       End With  'DataConConfigureWizard.ConfigText.BtnNext
  3674.       With .BtnBack
  3675.         .ZOrder := 18
  3676.         .Move(4575, 4020, 825, 300)
  3677.       End With  'DataConConfigureWizard.ConfigText.BtnBack
  3678.       With .BtnCancel
  3679.         .ZOrder := 19
  3680.         .Move(3675, 4020, 825, 300)
  3681.       End With  'DataConConfigureWizard.ConfigText.BtnCancel
  3682.       With .ImgGraphic
  3683.         .ZOrder := 20
  3684.         .Move(300, 300, 2250, 3150)
  3685.         .Picture := DataConConfigureWizard.Bitmap
  3686.       End With  'DataConConfigureWizard.ConfigText.ImgGraphic
  3687.       With .LblInstruction
  3688.         .Caption := "Select text file type and configuration options."
  3689.         .ZOrder := 21
  3690.         .Move(2925, 300, 4125, 450)
  3691.       End With  'DataConConfigureWizard.ConfigText.LblInstruction
  3692.       With .Frame1
  3693.         .ZOrder := 22
  3694.         .Move(75, 3795, 7050, 75)
  3695.       End With  'DataConConfigureWizard.ConfigText.Frame1
  3696.     End With  'DataConConfigureWizard.ConfigText
  3697.     With .SelectFile
  3698.       .Caption := "Configure DataControl"
  3699.       .Move(5610, 2115, 7230, 4785)
  3700.       .DefaultButton := DataConConfigureWizard.SelectFile.BtnNext
  3701.       .CancelButton := Nothing
  3702.       .wizard := DataConConfigureWizard
  3703.       .NextStep := DataConConfigureWizard.ConfigText
  3704.       .BackStep := DataConConfigureWizard.StartStep
  3705.       .DATABASE := Nothing
  3706.       With .TBFileName
  3707.         .Caption := "TBFileName"
  3708.         .ZOrder := 4
  3709.         .Move(2850, 750, 4050, 450)
  3710.       End With  'DataConConfigureWizard.SelectFile.TBFileName
  3711.       With .BTNBrowse
  3712.         .Caption := "Browse..."
  3713.         .ZOrder := 3
  3714.         .Move(5700, 1275, 1200, 300)
  3715.       End With  'DataConConfigureWizard.SelectFile.BTNBrowse
  3716.       With .TBFileView
  3717.         .Caption := "TBFileView"
  3718.         .ForeColor := 0
  3719.         .Font := DataConConfigureWizard.SelectFile.TBFileView.font
  3720.         .ZOrder := 2
  3721.         .Move(2850, 1950, 4050, 1650)
  3722.         .WordWrap := True
  3723.         .MultiLine := True
  3724.         .ScrollBars := "Both"
  3725.         With .font
  3726.           .FaceName := "Lucida Console"
  3727.           .Size := 8.000000
  3728.           .Bold := True
  3729.           .Italic := False
  3730.           .Strikethru := False
  3731.         End With  'DataConConfigureWizard.SelectFile.TBFileView.font
  3732.       End With  'DataConConfigureWizard.SelectFile.TBFileView
  3733.       With .BTNViewFile
  3734.         .Caption := "View File"
  3735.         .ZOrder := 1
  3736.         .Move(2850, 1575, 1500, 300)
  3737.       End With  'DataConConfigureWizard.SelectFile.BTNViewFile
  3738.       With .BtnFinish
  3739.         .Enabled := False
  3740.         .ZOrder := 5
  3741.         .Move(6300, 4020, 825, 300)
  3742.       End With  'DataConConfigureWizard.SelectFile.BtnFinish
  3743.       With .BtnNext
  3744.         .ZOrder := 6
  3745.         .Move(5400, 4020, 825, 300)
  3746.       End With  'DataConConfigureWizard.SelectFile.BtnNext
  3747.       With .BtnBack
  3748.         .ZOrder := 7
  3749.         .Move(4575, 4020, 825, 300)
  3750.       End With  'DataConConfigureWizard.SelectFile.BtnBack
  3751.       With .BtnCancel
  3752.         .ZOrder := 8
  3753.         .Move(3675, 4020, 825, 300)
  3754.       End With  'DataConConfigureWizard.SelectFile.BtnCancel
  3755.       With .ImgGraphic
  3756.         .ZOrder := 9
  3757.         .Move(300, 300, 2250, 3150)
  3758.         .Picture := DataConConfigureWizard.Bitmap
  3759.       End With  'DataConConfigureWizard.SelectFile.ImgGraphic
  3760.       With .LblInstruction
  3761.         .Caption := "Type the filename of the file to use or press Browse."
  3762.         .ZOrder := 10
  3763.         .Move(2850, 150, 4200, 450)
  3764.       End With  'DataConConfigureWizard.SelectFile.LblInstruction
  3765.       With .Frame1
  3766.         .ZOrder := 11
  3767.         .Move(75, 3795, 7050, 75)
  3768.       End With  'DataConConfigureWizard.SelectFile.Frame1
  3769.     End With  'DataConConfigureWizard.SelectFile
  3770.     With .ConfigCtrls
  3771.       .Caption := "Configure DataControl"
  3772.       .Move(5610, 2115, 7230, 4785)
  3773.       .DefaultButton := DataConConfigureWizard.ConfigCtrls.BtnFinish
  3774.       .CancelButton := Nothing
  3775.       .wizard := DataConConfigureWizard
  3776.       .BackStep := DataConConfigureWizard.Branch
  3777.       .DATABASE := Nothing
  3778.       With .LBControls
  3779.         .Caption := "LBControls"
  3780.         .ZOrder := 6
  3781.         .Move(2700, 825, 4350, 810)
  3782.         .IntegralHeight := False
  3783.       End With  'DataConConfigureWizard.ConfigCtrls.LBControls
  3784.       With .BTNClearLB
  3785.         .Caption := "Clear List"
  3786.         .Move(5550, 1650, 1500, 225)
  3787.       End With  'DataConConfigureWizard.ConfigCtrls.BTNClearLB
  3788.       With .LBFields
  3789.         .Caption := "LBFields"
  3790.         .ZOrder := 5
  3791.         .Move(3450, 2475, 3600, 1200)
  3792.         .Sorted := False
  3793.         .IntegralHeight := False
  3794.       End With  'DataConConfigureWizard.ConfigCtrls.LBFields
  3795.       With .BTNAdd
  3796.         .Caption := "Add"
  3797.         .ZOrder := 4
  3798.         .Move(3975, 2100, 900, 300)
  3799.       End With  'DataConConfigureWizard.ConfigCtrls.BTNAdd
  3800.       With .BTNRemove
  3801.         .Caption := "Remove"
  3802.         .ZOrder := 3
  3803.         .Move(4950, 2100, 900, 300)
  3804.       End With  'DataConConfigureWizard.ConfigCtrls.BTNRemove
  3805.       With .LBLControls
  3806.         .Caption := "Controls"
  3807.         .ZOrder := 14
  3808.         .Move(2775, 900, 900, 210)
  3809.         .Alignment := "Center"
  3810.       End With  'DataConConfigureWizard.ConfigCtrls.LBLControls
  3811.       With .LBLFields
  3812.         .Caption := "Fields"
  3813.         .ZOrder := 2
  3814.         .Move(2775, 2475, 600, 210)
  3815.         .Alignment := "Center"
  3816.       End With  'DataConConfigureWizard.ConfigCtrls.LBLFields
  3817.       With .DragFeedback
  3818.         .ZOrder := 1
  3819.         .Move(2700, 1875, 4350, 225)
  3820.       End With  'DataConConfigureWizard.ConfigCtrls.DragFeedback
  3821.       With .BtnFinish
  3822.         .ZOrder := 7
  3823.         .Move(6300, 4020, 825, 300)
  3824.       End With  'DataConConfigureWizard.ConfigCtrls.BtnFinish
  3825.       With .BtnNext
  3826.         .Enabled := False
  3827.         .ZOrder := 8
  3828.         .Move(5400, 4020, 825, 300)
  3829.       End With  'DataConConfigureWizard.ConfigCtrls.BtnNext
  3830.       With .BtnBack
  3831.         .ZOrder := 9
  3832.         .Move(4575, 4020, 825, 300)
  3833.       End With  'DataConConfigureWizard.ConfigCtrls.BtnBack
  3834.       With .BtnCancel
  3835.         .Enabled := False
  3836.         .ZOrder := 10
  3837.         .Move(3675, 4020, 825, 300)
  3838.       End With  'DataConConfigureWizard.ConfigCtrls.BtnCancel
  3839.       With .ImgGraphic
  3840.         .ZOrder := 11
  3841.         .Move(300, 300, 2250, 3150)
  3842.         .Picture := DataConConfigureWizard.Bitmap
  3843.       End With  'DataConConfigureWizard.ConfigCtrls.ImgGraphic
  3844.       With .LblInstruction
  3845.         .Caption := "Select controls and assign fields to them. ^M^J(Add Controls by dragging them with right mouse button onto box below.Be sure form edit is off.)"
  3846.         .ZOrder := 12
  3847.         .Move(2850, 150, 4200, 600)
  3848.       End With  'DataConConfigureWizard.ConfigCtrls.LblInstruction
  3849.       With .Frame1
  3850.         .ZOrder := 13
  3851.         .Move(75, 3795, 7050, 75)
  3852.       End With  'DataConConfigureWizard.ConfigCtrls.Frame1
  3853.     End With  'DataConConfigureWizard.ConfigCtrls
  3854.     With .Bitmap
  3855.       .LoadType := "MemoryBased"
  3856.       .FileName := "dbtools.ero"
  3857.       .ResId := 3884
  3858.     End With  'DataConConfigureWizard.Bitmap
  3859.   End With  'DataConConfigureWizard
  3860. End Code
  3861.